A regular dom element is such as:
document.getElementById('a')
or
document.createElement('div')
But jQuery returns elements in another format, so for instance I'd like to convert what is returned by $('#a')
to the same result as what is returned by document.getElementById('a')
Is this possible using jQuery?
thanks
You can reference the DOM element with .get(0)
or [0]
, eg $('#foo')[0]
assuming there is just one.
$('#a')[0]
// oops my answer is too short
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With