<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 ~~~ </Div>
<Br/>
<Input type = "button" onclick = "toggle ()" value = "Click here to try ...? "/>
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 = 'disable 'onclick = 'btnclick ()'> </div>"
DvMsg. innerHTML = strHtml;
Document. body. appendChild (dvMsg );
// Close the button
Btnclick = function (){
Document. body. removeChild (dvMsg );
-------------------------
Or use the div id to mark the pop-up layer.
<Div id = "tanchu"> pop-up layer content </div>
Js
Function open (){
Document. getElementById (tanchu). style. display = ""; // display
}
Function close (){
Document. getElementById (tanchu). style. display = "none"; // Do Not display (the page is also loaded during initialization)
}