Hi,
In your code you were doing assignments instead of comparisons. Using == or === will perform a comparison check.
function ChangeVis(id)
{
if (document.getElementById(id).style.visibility [COLOR="#FF0000"]===[/COLOR] "visible") {
document.getElementById(id).style.visibility = "hidden";
} else
if (document.getElementById(id).style.visibility [COLOR="#FF0000"]===[/COLOR] "hidden") {
document.getElementById(id).style.visibility = "visible";
}
}
Another way it could be done is like so:
function ChangeVis(id)
{
var e = document.getElementById(id);
e.style.visibility = (e.style.visibility === 'hidden') ? 'visible' : 'hidden';
}