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

📅  最后修改于: 2022-03-11 14:56:33.829000             🧑  作者: 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");
});