Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

JS Show/hide when button is clicked

var toggle  = document.getElementById("toggle");
var content = document.getElementById("content");

toggle.addEventListener("click", function() {
  content.classList.toggle("show");
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #JS #button #clicked
ADD COMMENT
Topic
Name
3+4 =