问答详情
源自:2-6 JavaScript-关闭窗口(window.close)

为什么我的这个框框运行出来不像任务的那个一样实体的呢,鼠标可以点进去

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>close()</title>
  <script type="text/javascript">
  	
         function openUrl(){
         	var mywin=window.open("http://www.imooc.com");
         var pages=confirm("是否关闭新页面?");
         if(pages==true){
         	mywin.close();
         	alert("页面已关闭!");
         }
         else{
         	alert("页面未关闭!");
         }
}
</script>
</head>
<body>
	<input name="botton" type="botton"  onclick="openUrl()" value="点击我,打开新的网页!"/>
</body>
</html>


提问者:慕容1519046 2017-02-27 23:16

个回答

  • I表人才
    2017-02-27 23:35:09
    已采纳

    excuse me.....it should be 'button' but 'botton'.......