调用控件的onkeyup事件<html>
<head>
<script language=javascript>
function check(){
//检查的代码
}
</script>
</head>
<body>
<input type="text" name="111" onkeyup="javascript:check();"></input>
</body>
</html>

解决方案 »

  1.   

    我还是不太明白怎么检查邮件的合法性,是调用TEXT控件的 onblur  changed onfocus哪个事件呀。
      

  2.   


    <html>
    <head>
    <script language=javascript>
    function check(){
        var Email = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
        return Email.test(111.value)?true:false;
    }
    </script>
    </head>
    <body>
    <input type="text" name="111" onkeyup="javascript:check();"></input>
    </body>
    </html>