Display element by date - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Date

Description

Display element by date

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <script type="text/javascript">
window.onload = function()/*from  w  ww .j ava2  s. c o m*/
{
    var currentTime = new Date()
    var month = currentTime.getMonth() + 1
    var day = currentTime.getDate()
    if(month == 10)
    {
        document.getElementById("my").style.display = 'block';
    }
    else
    {
        document.getElementById("my").style.display = 'none';
    }
}

      </script> 
   </head> 
   <body> 
      <h1 id="my" style="display:none">Day 1</h1> 
   </body>
</html>

Related Tutorials