<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 me appeared ~~~ </div>
<br />
<input type = "Button" onClight = "Toggle ()" Value = "Try to see ...?" />
Two methods: remove and hide
// Create your pop -up layer
var dvmsg = document.createElement ("div");
strhtml = "<div class = '####'> pop -up layer content </div>" "
Strhtml += "<div class = '####'> <input type = 'Button' value = 'Turn off' OnClick = 'Btnclick ()'> </DIV>"
dvmsg.innerhtml = strhtml;
document.body.appendchild (DVMSG);
// Close the button
btnclICK = Function () {{
document.body.removechild (DVMSG);
---------------------------
Or the pop -up layer is marked with a div ID
<div ID = "tanchu"> pop -up layer content </div>
in JS
function open () {
document.GetelementByid (tanchu) .style.display = "" "; // display
}
Function close () {) {
document.GetelementByid (tanchu) .style.display = "None"; // No display (the page was also loaded once when the page initialized)
}