html event attribute onblur triggered when an element loses focus

黄舟
Release: 2018-05-17 14:35:14
Original
8140 people have browsed it

Example

Validate the input field when the user leaves it:

Copy after login

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

Copy after login

Attribute value

Value Description
script Script to run when onblur occurs.

Example:

       OnBlur事件 
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!