Skip to content Skip to sidebar Skip to footer

Image Will Not Switch Between Hidden And Show

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? I have two different buttons, tryi

Solution 1:

The visibility style property has values of visible and hidden.

There is no show value.

functioninit() {
     document.getElementById("light").style.visibility = "hidden";
     var onButton = document.getElementById("onButton");
     onButton.onclick = function() {
        demoVisibility();
     }
   }

 functiondemoVisibility() {
     document.getElementById("light").style.visibility = "visible";
 }

Post a Comment for "Image Will Not Switch Between Hidden And Show"