How to know an object is jQuery object or not
我已经创建了一个函数,它告诉变量持有jQuery对象或者是否有任何替代。 以下是我的代码
1 2 3 4 5 6  | /*Is there any substitute of this function*/ function iSJqueryObj(elm) { return elm && jQuery.isFunction(elm.html); }  | 
http://jsfiddle.net/kE7Lp/3/
使用
1  | console.log(elm instanceof jQuery);  | 
要么:
1  | console.log(elm instanceof $);  | 
演示:http://jsfiddle.net/karim79/8jUKX/
试试这个例子
1  | obj instanceof jQuery  |