document.getElementById(“remember”).visibility = “hidden”; not working on a checkbox

前端 未结 3 658
遥遥无期
遥遥无期 2021-01-04 02:39

I cannot get the visibility or display properties to work.

Here is the HTML footer:

©
相关标签:
3条回答
  • 2021-01-04 03:00

    you can use

    style="display:none"
    

    Ex:

    <asp:TextBox ID="txbProv" runat="server" style="display:none"></asp:TextBox>
    
    0 讨论(0)
  • 2021-01-04 03:17

    There are two problems in your code:

    • The property is called visibility and not visiblity.
    • It is not a property of the element itself but of its .style property.

    It's easy to fix. Simple replace this:

    document.getElementById("remember").visiblity
    

    with this:

    document.getElementById("remember").style.visibility
    
    0 讨论(0)
  • 2021-01-04 03:22

    This is the job for style property:

    document.getElementById("remember").style.visibility = "visible";
    
    0 讨论(0)
提交回复
热议问题