I cannot get an image to switch back and forth between \'hidden\' and \'show\'
I\'m using ideas from How to create a hidden in JavaScript?>
The visibility style property has values of visible
and hidden
.
There is no show
value.
function init() {
document.getElementById("light").style.visibility = "hidden";
var onButton = document.getElementById("onButton");
onButton.onclick = function() {
demoVisibility();
}
}
function demoVisibility() {
document.getElementById("light").style.visibility = "visible";
}