How to use jQuery blur()

藏色散人
Release: 2020-11-30 13:54:31
Original
2700 people have browsed it

The jQuery blur() method is used to trigger the blur event. Its usage syntax is "$(selector).blur() $(selector).blur(function)". The parameter function indicates that it will run when the blur event occurs. The function.

How to use jQuery blur()

The operating environment of this tutorial: windows10 system, jquery2.2.4, this article is applicable to all brands of computers.

Recommended: "jquery video tutorial"

jQuery blur() method

The blur event occurs when the element loses focus .

blur() method triggers the blur event, or specifies a function to run when the blur event occurs.

Tip: This method is often used together with the focus() method.

Syntax

Trigger blur event for selected elements:

$(selector).blur()
Copy after login

Add function to blur event:

$(selector).blur(function)
Copy after login

Parameters

function can select. Specifies the function to run when the blur event occurs.

Example

Add function to blur event. The blur event occurs when thefield loses focus:

$("input").blur(function(){ alert("输入框失去了焦点"); });
Copy after login

Related free learning recommendations:JavaScript(video)

The above is the detailed content of How to use jQuery blur(). 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
Popular Recommendations
Popular Tutorials
More>
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!