<!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>