<script type= "Text/javascript" >
function Toggle () {
Theobj = document.getElementById (' Sunyanzi '). style;
if (Theobj.display = = "None") Theobj.display = "block"; else Theobj.display = "none";
}
</script>
<div id= "Sunyanzi" style= "Display:none" > You see I showed up ~~~</div>
<br/>
<input type= "button" onclick= "Toggle ()" value= "Click to try ...?"/>
Two ways: removing and hiding
Create your pop-up layer
var dvmsg = document.createelement ("div");
strhtml = "<div class= ' > Pop-up content </div>"
strHTML + + <div class= ' ><input type= ' button ' value= ' Close ' onclick= ' Btnclick () ' ></div> '
dvmsg.innerhtml = strhtml;
Document.body.appendChild (DVMSG);
Close button
Btnclick = function () {
Document.body.removeChild (DVMSG);
-------------------------
Or the pop-up layer is tagged with a div ID
<div id= "Tanchu" > Pop-up content </div>
JS
function Open () {
document.getElementById (tanchu). style.display= ""; //Display
}
Function Close () {
document.getElementById (tanchu). style.display= "None"; //Do not display (same load once page initialization)
}