Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Ocultar o mostrar elementos html con js

//elemento html
<div id="myDIV"> </div>

//funcionn js
function myFunction() {
    var x = document.getElementById("myDIV");
    if (x.style.display === "none") {
        x.style.display = "block";
    } else {
        x.style.display = "none";
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Ocultar #mostrar #elementos #html #js
ADD COMMENT
Topic
Name
7+9 =