Home  >  Article  >  Web Front-end  >  DIV 隐藏问题,求帮助_html/css_WEB-ITnose

DIV 隐藏问题,求帮助_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:24:491067browse






${list_in.CD_Name }



设置了DIV属性但是不隐藏,我本来会想用JS动态隐藏这个的,但是也没实现
我的JS代码
document.getElementById("CD_ID1").style.display="none";

回复讨论(解决方案)

确定id是 cd_id1吗

确定






${list_in.CD_Name }



设置了DIV属性但是不隐藏,我本来会想用JS动态隐藏这个的,但是也没实现
我的JS代码
document.getElementById("CD_ID1").style.display="none";

确定id是 cd_id1吗
确定

id="CD_ID${list.CD_ID}"

id肯定是CD_ID+字符。


确定id是 cd_id1吗
确定
是不是代码执行先后顺序有问题,页面还没生成好就执行了,
document.getElementById("CD_ID1").style.display="none";
在设置的代码前面加个alert,看看弹出对话框的时候div是不是已经显示了。



<script> <br /> var items = document.getElementsByName('cd_id'); <br /> for( var i = 0 ; i < items.length; i++ ) items[i].style.display='none'; <br /> <br /> </script>



确定id是 cd_id1吗
确定
是不是代码执行先后顺序有问题,页面还没生成好就执行了,
document.getElementById("CD_ID1").style.display="none";
在设置的代码前面加个alert,看看弹出对话框的时候div是不是已经显示了。
已经显示出来了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn