jQuery blur()Methods
Example
Add a function to the blur event. The blur event occurs when the <input> field loses focus:
$("input").blur(function(){
alert("The input field lost focus");
});
alert("The input field lost focus");
});
Try it yourself »
Definition and Usage
The blur event occurs when an element loses focus.
The 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 thefocus()method.
Syntax
Trigger the blur event for the selected elements:
$(selector).blur()
Try it yourself
Add a function to the blur event:
$(selector).blur(function)
Try it yourself
| Parameters | Description |
|---|---|
| function | Optional. Specifies a function to run when the blur event occurs. |
Other Extensions
jQuery Event Methods