<script type = "text/javaScript">
함수 toggle () {) {
theobj = document.getElementById ( 'sunyanzi');
if (theobj.display == "none") theobj.display = "block";
}
</스크립트>
<div id = "sunyanzi"style = "display : none"> 당신은 내가 나타난 것을 본다 ~~~ </div>
<br />
<input type = "button"onclight = "toggle ()"value = "봐봐 ...?"
두 가지 방법 : 제거 및 숨기십시오
// 팝 -UP 레이어를 만듭니다
var dvmsg = document.createElement ( "div");
strhtml = "<div class = '####'> pop -up 레이어 컨텐츠 </div>" "
strhtml += "<div class = '####'> <input type = 'button'value = '끄기'onclick = 'btnclick ()' '> </div>"
dvmsg.innerhtml = strhtml;
Document.body.appendChild (DVMSG);
// 버튼을 닫습니다
btnclick = function () {{
Document.body.removeChild (DVMSG);
-------------------------------
또는 POP -UP 레이어에는 div id가 표시됩니다.
<div id = "tanchu"> pop -up 레이어 컨텐츠 </div>
JS에서
function open () {
document.getElementById (tanchu) .style.display = "" "; // display
}
함수 close () {) {
getElementByid (tanchu) .style.display = "none";
}