<!DOCTYPE html>
<html>
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<script type="text/javascript">
function openWindow(){
var mymessage=confirm("确定打开新窗口吗?");
if(mymessage==true)
{ prompt("为了您的账户安全,请输入您的名字!");
window.open("www.baidu.com",'_black');
}
else
{ document.write("出错了!"); }
}
</script>
</head>
<body>
<form>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</form>
</body>
</html>