📜  隐藏 div - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:33.038000             🧑  作者: Mango

代码示例4
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";
  }
};