上面的代碼中怎麼會提示Event事件沒有定義?

解决方案 »

  1.   

    <html>
    <head>
    </head>
    <body>
    <form name="myform">
    <input type="text" size="2" value="" name="mytext" onclick="changText();">
    </form>
    <script language="javascript">
    //document.captureEvents(event.click); 
    document.onclick=mychick;
    document.onclick=mychick;
    var i=0;
    function mychick()
    {
    window.document.myform.mytext.value="sadf";
    }

    function changText()
    {
    window.document.myform.mytext.value=i++;
    }
    </script>
    </body>
    </html>