Thursday, May 23, 2024
 Popular · Latest · Hot · Upcoming
150
rated 0 times [  153] [ 3]  / answers: 1 / hits: 169125  / 12 Years ago, sun, december 23, 2012, 12:00:00

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;

More From » visibility

 Answers
35

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

[#81262] Friday, December 21, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mackennamelissac

Total Points: 110
Total Questions: 118
Total Answers: 103

Location: Sweden
Member since Sun, Jan 16, 2022
2 Years ago
mackennamelissac questions
Thu, Jun 3, 21, 00:00, 3 Years ago
Tue, Mar 23, 21, 00:00, 3 Years ago
Sun, Dec 27, 20, 00:00, 3 Years ago
;