Removing <div> if Javascript is disabled, show div if Javascript is enabled - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Div

Description

Removing <div> if Javascript is disabled, show div if Javascript is enabled

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <style id="compiled-css" type="text/css">

ul {//from   w ww .  ja v  a2s. co  m
   display: none;
}


      </style> 
      <script type="text/javascript">
    window.onload=function(){
document.getElementById('menu').style.display = "block";
    }

      </script> 
   </head> 
   <body> 
      <ul id="menu"> 
         <li>Menu Item 1</li> 
         <li>Menu Item 2</li> 
         <li>Menu Item 3</li> 
      </ul>  
   </body>
</html>

Related Tutorials