Posted in Javascript onFebruary 15, 2009
<HTML> <HEAD> <script language="javascript"> attachEvent("onblur", blur); function blur() { document.all.form.username.attachEvent("onblur", blur); if(event.srcElement == document.all.form.username){ alert("efewef"); } } </script> </HEAD> <BODY> <form name="form"> <input type="text" name="username" onblur="alert('hello')"> </form> </BODY>
其执行顺序为:
先执行alert("hello");
后执行alert("efewef");
动态为事件添加js代码示例
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@