<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
<SCRIPT LANGUAGE="JavaScript">
<!--
function setStyle(obj,sty){
var style = obj.style;
for(var tmp in sty){
style.setAttribute(tmp, sty[tmp]);
}
}
Win = function(msg){
var win = document.createElement("div");
setStyle(win,{border:"1px red solid",width:"80px",height:"100px",position:"absolute",top:"100px",left:"300px"});
//win.style.width="80px";
//win.style.height="100px";
//win.style.border="1px red solid";
//win.style.position="absolute";
//win.style.top="100px" ;
//win.style.left="300px";
var textNode = document.createTextNode(msg);
win.appendChild(textNode);
var onclkdiv = document.createElement("div");
var onclk = document.createElement("input");
onclk.type = "button";
onclk.value = "ok";
onclk.onclick=function(){
document.body.removeChild(win);
}
onclkdiv.appendChild(onclk);
win.appendChild(onclkdiv);
document.body.appendChild(win);
}
Win("hello world");
//-->
</SCRIPT>
jsoo编程实例之模拟弹出窗口
最新推荐文章于 2022-07-31 06:43:05 发布