Answers for "how to make html contents hidden till button is clicked in js"

1

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");
});
Posted by: Guest on November-25-2021

Code answers related to "how to make html contents hidden till button is clicked in js"

Browse Popular Code Answers by Language