为什么下面的代码在IE浏览器(7和8)中不起作用?jQuery:attr风格在IE中不起作用
$("ul li").each(function() {
if(($.trim($(this).attr("style"))) != "display: none;"){
//if content
}else if(($.trim($(this).attr("style"))) == "display: none;"){
//else content
}
});
注意:前4个li元素没有“样式”属性,其余8个元素没有。
哈克,我们可以普莱舍看到,该室内用的HTML? – mcgrailm 2011-05-31 13:30:17
你可以告诉我们在http://jsfiddle.net/ – SinistraD 2011-05-31 13:30:23
你使用的是什么版本的jquery? – mcgrailm 2011-05-31 13:32:13