📜  onclick 隐藏 div javascript - Html 代码示例

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

代码示例2
var toggle  = document.getElementById("toggle");
var content = document.getElementById("content");

toggle.addEventListener("click", function() {
  content.classList.toggle("show");
});