幫忙看下哪錯(cuò)了,點(diǎn)擊后沒(méi)反應(yīng),謝謝?。。?/h1>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>close()</title>
? <script type="text/javascript">
?????? function ahou(){
?????????? var mywin=window.open("http://idcbgp.cn");
????? var win=confirm("guan?");
????? if(win==ture){
??????? mywin.close();? }
??????? else{alert("不關(guān)");}
??????? }
? </script>
</head>
<body>
<input type="button" name="button" value="are you sure?" onClick="ahou"/>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>close()</title>
? <script type="text/javascript">
?????? function ahou(){
?????????? var mywin=window.open("http://idcbgp.cn");
????? var win=confirm("guan?");
????? if(win==ture){
??????? mywin.close();? }
??????? else{alert("不關(guān)");}
??????? }
? </script>
</head>
<body>
<input type="button" name="button" value="are you sure?" onClick="ahou"/>
</body>
</html>
2016-01-09
函數(shù)沒(méi)有調(diào)用,少了括號(hào)--->onclick="ahou()"
if語(yǔ)句里的true寫錯(cuò)了