我尝试了下面这个方法。我认为 $("div.tab_select")[0] 返回的对象不是一个 jQuery 对象,但我甚至无法使用纯 javascript 方法。
有没有办法将其转换成 jQuery 对象?例如 $($("div.tab_select")[0])。我知道这很愚蠢;
谢谢您的阅读。
有没有办法将其转换成 jQuery 对象?例如 $($("div.tab_select")[0])。我知道这很愚蠢;
谢谢您的阅读。
var tmp = $("div.tab_select")[0];
alert(tmp); //This gives me HTMLDivElement collectly. But I can't use any of javascript..
alert(tmp.nodeName); //But this give me error "Uncaught TypeError: Cannot read property 'nodeName' of undefined"
tmp.hide(); //Neither, I can't use this.
var tmp = $("div.tab_select:first");
或者var tmp = $("div.tab_select:eq(0)");
。 - j08691