如何用 javascript 改变 Visible属性 ,但是不想用----document.getElementByID("TextBox1").style.displye="none"----

解决方案 »

  1.   

    我开始用的是
    document.getElementByID("DropDownLoad1").style.displye="none"
    可是当我
    document.getElementByID("DropDownLoad1").style.displye="true"
    的时候我的 DropDownLoad1 就好像他前面加了一个<br>一样错位了
      

  2.   

    我开始用的是
    document.getElementByID("DropDownLoad1").style.displye="none"
    可是当我
    document.getElementByID("DropDownLoad1").style.displye="true"
    的时候我的 DropDownLoad1 就好像他前面加了一个<br>一样错位了
      

  3.   

    document.getElementByID("DropDownLoad1").style.displye="block" 
      

  4.   


    隐藏 document.getElementByID("DropDownLoad1").style.displye="none" 显示document.getElementByID("DropDownLoad1").style.displye="inline"  或者为空都可以
      

  5.   

    Visible是显示和隐藏的属性 对应Javascript的 document.getElementByID("TextBox1").style.displye
    LZ是不是要灰掉该控件?那是Enable属性 对应Javascript的 document.getElementByID("TextBox1").disabled="disabled"
      

  6.   

    Try
    yourcontrol.style.visibility = false;
      

  7.   

    Sorry, it should be:
    yourcontrol.style.visibility = 'hidden';Set it to 'visible' to show yourcontorl.
      

  8.   

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>无标题页</title>
        <script type="text/javascript">
        function RemoveElement()
        {
            var div =  document.getElementById("holder");
            var test = document.getElementById("test");
            div.removeChild(test);
        }
        
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div id="holder">
        <div id="test">12312312321</div>
         <input type="button" onclick="RemoveElement()" value="test" id="as" />
        
        </div>
        </form>
    </body>
    </html>
      

  9.   

    这样用remove的好处是页面的元素被移除,而不仅仅是隐藏,LS几位都是隐藏实际元素还是存在,对于一些希望不能不看到的内容最好不要用隐藏。
      

  10.   

    document.getElementByID("DropDownLoad1").style.displye="inline"  或者为空都可以 
    注意,是inline,如果是block则会独占一行显示。
      

  11.   

    无语 要搞清楚什么是 display 什么是 visibility  
    他们是不同的  dispaly 会空出位子  后面一个会保留 属性也不一样
    第一个是 blcok  none 第二个是 visiable hidden