How do I check if a variable is a jQuery object or plain DOM element?
Asked
Active
Viewed 5,158 times
19
-
3See http://stackoverflow.com/questions/1853223/check-if-object-is-a-jquery-object – Crescent Fresh Aug 06 '10 at 17:30
1 Answers
41
- A jquery object has a
jquery
property. - A jquery object is an
instanceof jQuery
(instanceof
on MDN) - A DOM element has a
nodeType
property

fregante
- 29,050
- 14
- 119
- 159

meder omuraliev
- 183,342
- 71
- 393
- 434