Answers for "Ocultar o mostrar elementos html con js"

0

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";
    }
}
Posted by: Guest on February-09-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language