Javascript examples for CSS Style Property:display
Show and hide element via CSS style display
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from www.jav a2 s . c om var elems = document.querySelectorAll('p,li'); for(var i = 0;i < elems.length; i++) { elems[i].style.display = 'none'; } } </script> </head> <body> <p>1</p> <ul> <li>2</li> </ul> </body> </html>