& lt; ! Doctype html>
<meta charset="utf-8" & gt;JavaScript event element loses focus browsers do not display & lt;/title>
<style>
</style>
<body>
<script>
//JavaScript event element loses focus browsers do not display
//event focus
Var name=document. GetElementById (" username ");
Name. The onblur=function () {
Alert (" element loses focus!" );
}
</script>
CodePudding user response:
Don't do a global variable with the name, a variable name.Because global variables in js attributes of the object is the window, the window object in the name of this there is an inherent attribute, is the name of the window, the value can only be as a string,