Answers for "open hide div"

CSS
9

how to hide div in html

document.getElementById('elementName').hide();
Posted by: Guest on November-09-2019
0

hide a div

const targetDiv = document.getElementById("third");
const btn = document.getElementById("toggle");
btn.onclick = function () {
  if (targetDiv.style.display !== "none") {
    targetDiv.style.display = "none";
  } else {
    targetDiv.style.display = "block";
  }
};
Posted by: Guest on December-24-2021

Browse Popular Code Answers by Language