jQuery object is a wrap of the DOM object, but itself is not a DOM object. If you want to get the DOM object from the jQuery object, you should use get() method.
For example, if the jQuery object includes only one DOM object, you can use
$("div").get(0)
or
$("div")[0]
However, if you have multiple DOM objects, you can use
$("div").get()
Subscribe to:
Post Comments (Atom)

Short and usefull. Thanks
ReplyDeleteThis commenting method REALLY sucks...
Now after couple of times when I was trying to comment your post(FINALLY!) I have to say that this commenting method REALLY REALLY SUCKS...
ReplyDeleteIf You want any coments You'd better change it to something NORMAL. I had to try 4 times before posting my previous comment and normal people aren't so pacient.
Cheers:)
helpful
ReplyDeleteThanks a lot, it helped me :)
ReplyDeleteThanks!
ReplyDeleteHow do you go the other way around? I have a DOM pointer and I want to use jquery functions on it.
ReplyDeleteI need to be able to use jquery functions on a DOM pointer/object too.
ReplyDelete@mslocum and @Daniel: That's easy! Just wrap it in $() -- for instance, say, you have a DOM object created like this:
ReplyDeletedomObject = document.getElementById('mydiv');
you can turn it into a jQuery object by going like this:
$(domObject)
It works!!
ReplyDeleteCool
ReplyDeleteTNX it usefull!
ReplyDelete