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

javascript, visibility

Solution

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

Problem

I cannot get the `visibility` or `display` properties to work. Here is the HTML footer: ``` <div id="footer"> &copy; <strong id="foot" onmouseover="showData();" onmouseout = "hideData()"> Exquisite Taste 2012 </strong> <input type='checkbox' id="remember" onclick='editCookie()' style="visibility:hidden;" /> </div> ``` Here is the .js function with the visibility part not working: ``` function showData() { document.getElementById("remember").visiblity="visible"; document.getElementById("foot").innerHTML = getDate() + " " + getTime(); if(cookieValue()) { document.getElementById("remember").checked = true; } } ``` That one line doesn't seem to do anything: ``` document.getElementById("remember").visiblity="visible"; ```

Original source