如何检查变量是jQuery对象还是普通DOM元素?
如何检查变量是jQuery对象还是普通DOM元素?
- jquery对象具有
jquery
属性。 - jquery对象是
instanceof jQuery
的instanceof jQuery
( MDN上的instanceof
) - DOM元素具有
nodeType
属性
如何检查变量是jQuery对象还是普通DOM元素?
jquery
属性。 instanceof jQuery
的instanceof jQuery
( MDN上的instanceof
) nodeType
属性