Home > Web Front-end > JS Tutorial > body text

Use js to close the window of the js pop-up layer_javascript skills

WBOY
Release: 2016-05-16 17:00:55
Original
1161 people have browsed it





Two methods: remove and hide

//Create your pop-up layer
var dvMsg = document.createElement("div");
strHtml = "

Pop-up layer content"
strHtml = "
"
dvMsg.innerHTML = strHtml;
document.body.appendChild(dvMsg);
//Close button
btnclick = function (){ ld(dvMsg);

-------------------------


or the popup layer is marked with div id

Pop-up layer content

js
function open(){
document.getElementById(tanchu).style.display=""; //Display
}
function close() {
document.getElementById(tanchu).style.display="none"; //Does not display (load again when the page is initialized)
}

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template