Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

toggle hidden attribute javascript

function myFunction(id) {
  var x = document.getElementById(id);
  if (x.style.display === "none") {
    x.style.display = "block";
  } else {
    x.style.display = "none";
  }
}
 
PREVIOUS NEXT
Tagged: #toggle #hidden #attribute #javascript
ADD COMMENT
Topic
Name
1+7 =