新窗口的创建
<!DOCTYPE html>
<html>
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript">
function openWindow(){
var mywin=confirm("是否创建新窗口?");
var mywin1="新窗口的地址为:";
if(mywin==true){
prompt(mywin1,"https://www.youkuaiyun.com/");
window.open('https://www.youkuaiyun.com/','_blank','width=400px,height=500px,menubar=no,toolbar=no');
}//对新窗口进行属性设置
else{
window.close();
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" οnclick="openWindow()" />
</body>
</html>