DIV 控制:内容的显示和隐藏

    技术2025-10-07  6

    <html> <head> <mce:script type="text/javascript"><!-- function removeElement() { var tag = document.getElementById("p1"); if(tag.style.display=="none"){ tag.style.display="block" ; }else{ tag.style.display="none" ; } } // --></mce:script> </head> <body> <h1>This is a header</h1> <p id="p1">This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.</p> <input type="button" οnclick="removeElement()" value="Do not display paragraph" /> </body> </html>

    最新回复(0)