Javascript examples for DOM HTML Element:Style
Change CSS style display value from block to none in Javascript
<html> <head></head> <body> <input type="button" onmousedown="show()" onmouseup="hide()" <p id="elem"> Some text here.Some text here.Some text here.Some text here.Some text here. <p></p> value="Toggle"> <script> function show() {//from w w w. ja va 2 s . com var elem = document.getElementById('elem'); elem.style.display = 'block'; } function hide() { var elem = document.getElementById('elem'); elem.style.display = 'none'; } </script> </body> </html>