JS 显示隐藏DIV

JS关闭DIV HTML <div> <p>关闭</p> </div> <div> <p>关闭</p> </div> JS <script type="text/javascript"> function removeElement(id) { document.getElementById(id).style.display="none"; } </script> JS显示DIV <div>点击显示另一个div</div> <div>点击后显示的div</div> <script type="text/javascript"> function showOtherDiv(){ //获取要显示的div对象 var otherDiv=document.getElementById(\'otherDiv\'); //显示 otherDiv.style.display="block"; } </script>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zwgxyj.html