js实现点击按钮或div显示与隐藏div
var box = document.getElementById("box");
var btn = document.getElementById("btn"); btn.onclick = function(event){ event.stopPropagation(); if(box.style.display == "none"){ box.style.display = "block"; }else{ box.style.display = "none"; }};window.onclick = function(){ box.style.display = "none"};
浙公网安备 33010602011771号