Example
Validate the input field when the user leaves it:
Browser support
IE
Firefox
Chrome
Safari
Opera
All major browsers support onblurattribute.
Definition and Usage
The onblur attribute is triggered when the element loses focus.
onblur is often used inform validationcode (such as the user leaving a form field).
Tip: The onblur attribute is the opposite of theonfocusattribute.
Differences between HTML 4.01 and HTML5
None.
Syntax
Attribute value
Value | Description |
script | Script to run when onblur occurs. |
Example:
The above is the detailed content of html event attribute onblur triggered when an element loses focus. For more information, please follow other related articles on the PHP Chinese website!