<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>电灯开关案例</title>


<script>
    /** 练习:点击按钮,开灯或关灯 */
    var flag = false;//false表示默认状态为关灯
    function changeImg(){
        console.log("this is show work good!");
        showInfo=window.open("3.html",'','width=200,height=100');
    }
    function closeit()
    {
    setTimeout("showInfo.close()", 2000)   //毫秒
    }
   
</script>
</head>
<body>
    <input type="button" value="开/关灯"
        onclick="changeImg()" /> <br/><br/>

<body onload="closeit()">    
</body>
</html>

 

相关文章:

  • 2022-12-23
  • 2021-10-29
  • 2022-12-23
  • 2021-08-09
  • 2021-05-31
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案