element.style.display='none' is not working
<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript"&gt;

function nameofmonth(month)
 {  
 var monthname=new  Array("January","February","March","April","May","June","July","August","September","October","November","December")
  return monthname[month]
}  
 function monthdays(month,year)
 {
  var daysofmonth=new Array(31,28,31,30,31,30,31,31,30,31,30,31)
  if(year%4==0)
  daysofmonth[1]=29  
  return daysofmonth[month]   
  }
 function close(){

 document.getElementById("container").style.display='none'
 }

 function table()
  {
   var now=new Date()
   var hour=now.getHours()
   var minute=now.getMinutes()
   var second=now.getSeconds()
   var date=now.getDate()
   var month=now.getMonth() 
   var year=now.getFullYear()
   now.setFullYear(year,month,1)
   var firstday=now.getDay()
   var monthname=nameofmonth(month)
   var daysofmonth=monthdays(month,year)
    if(firstday&gt;0)
      var k=-(firstday-1)
    else
      k=1
   var table="&lt;table border=5 cellspacing=3cellpadding=8&gt;"
   table +="&lt;tr&gt;&lt;th colspan=7&gt;"+monthname + date+"th&lt;/th&gt; &lt;td  style='cursor:pointer' onclick='close()'&gt;[close]&lt;/td&gt;&lt;/tr&gt;"
   table +="&lt;tr&gt;&lt;th&gt;sun&lt;/th&gt;&lt;th&gt;mon&lt;/th&gt;&lt;th&gt;tue&lt;/&gt;&lt;th&gt;wed&lt;/th&gt;&lt;th&gt;thu&lt;/th&gt;&lt;th&gt;fri&lt;/&gt;&lt;th&gt;sat&lt;/th&gt;&lt;/tr&gt;"
   for(var i=0;i&lt;5;i++)
    {
     table+="&lt;tr&gt;"
     for(var j=0;j&lt;7;j++)
      {
        if(k&lt;=daysofmonth &amp;&amp; k&gt;0)
          { if(k==date)
             table+='&lt;td id="clock" bgcolor="aqua"&gt;'+k+'&lt;/td&gt;'
          else
           table+='&lt;td style="cursor:pointer"&gt;'+k+'&lt;/td&gt;'
           k=parseInt(k)

         }
      else
         table+="&lt;td&gt;&lt;/td&gt;"
         k++
       }
  table+="&lt;/tr&gt;"
  document.getElementById("calender").innerHTML=table  
}
}


&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;input type="text" onclick="table()"/&gt;
&lt;table id="container"&gt;&lt;tr&gt;&lt;td id="calender"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>This is my code of a calender which appears after clicking on a textbox.Here is a close cell in table.when close is clicked the close() function will called and calender will disappear.But this is not happening.why?please help me...thanks in advance..</p>
