<!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://www.imooc.com");
var win=confirm("guan?");
if(win==ture){
mywin.close(); }
else{alert("不关");}
}
</script>
</head>
<body>
<input type="button" name="button" value="are you sure?" onClick="ahou"/>
</body>
</html>
函数没有调用,少了括号--->onclick="ahou()"
if语句里的true写错了