<!DOCTYPE?HTML>
<html>
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/>
<title>close()</title>
??<script?type="text/javascript">
?????function?myWin(){
????????var?choice=confirm("你想要打開(kāi)新窗口嗎")
????????if(choice==true)
?????{window.open("http://idcbgp.cn");}
????????else
????????{???
????????????window.close("http://idcbgp.cn");
????????????alert("已關(guān)閉");}
?????}
??</script>
</head>
<body>
????<form>
????????<input?name="button"?type="button"?onClick="myWin()"?value="打開(kāi)新窗口">
????</form>
</body>
</html>

2016-12-13
var?choice=confirm("你想要打開(kāi)新窗口嗎")后面缺少;
2016-12-13
編的少這些小錯(cuò)誤就是多哈,多謝