我的系统在IE8上运行,现在这个客户想在windows7 + IE11上使用这个系统。此代码“style.display = 'none'”不起作用。
<script language="JavaScript">
function hide(){
var type2=document.getElementsByName("type2");
for(var i=0;i<type2.length;i++){
type2[i].style.display="none";
}
}
</script>
<table border="0" >
<tr>
<td nowrap align="left" id="type2">
<bean:message bundle="ests" key="part"/>
</td>
<td nowrap align="left" id="type2"><bean:message bundle="ests" key="ests.estRequest.label.businessKanriNo"/>
</td>
<td nowrap align="left" id="type2"><html:text maxlength="7" property="businessKanriNo" size="15" />
</td>
</tr>
</table>
最佳答案
$('.btn').css('display','block','important');
或者你可以在 css 中使用它
display:none !important
或者您可以在 jquery 中使用 hide() 来隐藏元素。像这样
$(document).ready(function(){
$('p').hide(); //if you wanna hide <p>
}):
关于jquery - style.display = 'none' 适用于 IE8 但不适用于 IE11,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33274424/