Validate an input field when the user leaves it:
![]()
The onblur event attribute is supported in all major browsers.
The onblur attribute fires the moment that the element loses focus.
Onblur is most often used with form validation code (e.g. when the user leaves a form field).
Tip: The onblur attribute is the opposite of the onfocus attribute.
None.
| Value | Description |
|---|---|
| script | The script to be run on onblur |
HTML Event Attributes
Your message has been sent to W3Schools.