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

前端 未结 3 659
遥遥无期
遥遥无期 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: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
    

提交回复
热议问题