各位大哥是这样,控件上也有onclick事件,我在控件的onclick事件写了:
 
function $(id)
    {            return document.getElementById(id);     
    }function ShowDate()
  {
    
    if($("pnlDate").style.display=='none')
    {
        $("pnlDate").style.display='';
    }
    else
    {
        
        $("pnlDate").style.display='none';
        
    }
  }function CloseDate()
  {
    if($("pnlDate").style.display=='')
    {
        $("pnlDate").style.display='none';
    }
    
  }
<body style=" margin-top: 0px; left: 0px; margin-left: 0px;top:0px" onclick="CloseDate()">
 <input id="txtDate" onclick="ShowDate()" type="text" /></td>我的意思是点击checkbox,,,"pnlDate"控件消失或出现,而点击页面部分时,控件"pnlDate"肯定消失;但在body 里面写onclick事件的方法,就把checkbox的onclick事件的方法给覆盖了,控件"pnlDate"无法出现,在<form id="form1" runat="server" onclick="CloseDate()" >也布可以