Uncaught typeError:Cannot read property 'style' of undefined
想实现点击某项,可弹出框,并且背景灰色且不可操作。运行后发现没弹出框,Chrome中调试发现到红色行时报错:Uncaught typeError:Cannot read property 'style' of undefined
各位谁知道怎么回事?怎么解决??
js:
function locking(id) {
document.all.zzjs_net.style.display = "block"; document.all.zzjs_net.style.width = document.body.clientWidth;
document.all.zzjs_net.style.height = document.body.clientHeight;
$("#www_zzjs_net_" + id).css("display", "block");
document.body.style.overflow = "hidden";
}
html:
<li onclick="locking(<%#Eval("MenuID") %>);" class="menu_one" style="cursor:pointer;">
<div id='<%# GetLa(Eval("bHot"))%>'>
<%#Eval("Number")%>.<%#Eval("MenuName_EN")%>
</div>
</li>
<div id="www_zzjs_net_<%# Eval("MenuID") %>" ></div> css style Uncaught?typeError locking
[解决办法]
都用jquery获取和设置style值不更方便吗?为什么部分用部分不用jquery?