<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>close()</title>
<script type="text/javascript">
var closew=window.open('http://www.imooc.com','_blank','height=200,width=200');
function closewin(){
closew.close();
}
</script>
</head>
<body>
<input name="button" type="button" onClick="mywin()" value="点我点我点我">
<input name="button" type="button" onClick="close()" value="关掉我">
</body>
</html>
关闭命令打错了,是window.close();
改成
<input name="button" type="button" onClick="closewin()" value="关掉我">