Home >Web Front-end >JS Tutorial >Dynamically add js code examples for events_javascript skills

Dynamically add js code examples for events_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:56:05807browse
Copy code The code is as follows:



< ;script language="javascript">
attachEvent("onblur", blur);
function blur()
{
document.all.form.username.attachEvent("onblur", blur );
if(event.srcElement == document.all.form.username){
alert("efewef");
}
}








The execution order is:
execute alert("hello") first;
then execute alert("efewef");
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn