为啥我点击按钮没有任何效果
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>close()</title>
<script type="text/javascript">
var mywin=window.open("http://www.imooc.com");
function close(){
var answer=confirm("是否要关闭此窗口?");
if(answer==true){
mywin.close();
alert("已关闭");
}else
{
alert("关闭失败");
}
}
</script>
</head>
<body>
<input type="submit" value="点击关闭" onclick="close()"/>
</body>
</html>