📜  弹出 JavaScript 代码 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:22.649000             🧑  作者: Mango

代码示例1
document.getElementById("open-popup-btn").addEventListener("click",function(){
  document.getElementsByClassName("popup")[0].classList.add("active");
});
 
document.getElementById("dismiss-popup-btn").addEventListener("click",function(){
  document.getElementsByClassName("popup")[0].classList.remove("active");
});