<asp:DropDownList ID="DropDownList4" runat="server" CssClass="DropDownList" onchange="ChangeEndTime()">
            </asp:DropDownList>
<asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox>
function ChangeEndTime()
{
    var EndTime=document.getElementById("TextBox1");
    EndTime.value="";
    EndTime.style.displye="none"; 
}运行没有达到效果,textbox1依然显示。为什么?

解决方案 »

  1.   

    你的单词都没有写对。
    不是"displye",应该是display
      

  2.   

    EndTime.Visible=fasle;或
    EndTime.Attribute["style"]="display:none";
      

  3.   

    var txt=document.getElementById(""); 
    txt.style.visibility  =  "hidden"; style= "display:none "
      

  4.   

    jquery
    function Hidemap() 
    {
       $('#TextBox1').css('display', 'none');
    }
      

  5.   

    javascript函数里可以控制服务器控件吗?
      

  6.   

    document.getElementById("text1").style.display="none";
      

  7.   

    document.getElementById("TextBox1").style.display = "none"; //显示
      

  8.   

    更多的时候,服务器端控件的ID和客户端的ID不一样,也应该注意这个问题吧