这我知道,可如何用button实现呢?

解决方案 »

  1.   

    window.opener=null
    window.close()<input type=checkbox onclick="(this.checked)?m.style.display='':m.style.display='none'">
    <input name=m style="display:none">
      

  2.   

    window.opener=null
    window.close()<input type=checkbox onclick="(this.checked)?m.style.display='':m.style.display='none'">
    <input name=m style="display:none">
      

  3.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    </HEAD>
    <script>
    function CreateInput(el)
    {
      if (el.checked)
      {
        var t = document.createElement("input");
        t.type = "text";
        document.body.appendChild(t);
      }
    }
    </script>
    <BODY>
    <input type="checkbox" onclick="CreateInput(this)">CreateInput
    </BODY>
    </HTML>
      

  4.   

    <button onclick="window.close()">
      

  5.   

    <html>
    <head>
    <script language="javascript">
    <!--
    function closeme()
    {
    window.close();
    }
    -->
    </script>
    </head>
    <body>
    <input type="button" onclick="closeme()">
    ...
    </body>
    </html>