HTML DOM blur() Method
Element Object
Example
Remove focus from an <a> element:
document.getElementById("myAnchor").blur();
Try it yourself »
More "Try it Yourself" examples below.
Definition and Usage
The blur() method is used to remove focus from an element.
Tip: Use the focus() method to
give focus to an element.
Browser Support
Method |
|
|
|
|
|
blur() |
Yes |
Yes |
Yes |
Yes |
Yes |
Syntax
Parameters
Technical Details
Return Value: |
No return value |
More Examples
Example
Remove focus from a text field:
document.getElementById("myText").blur();
Try it yourself »
Related Pages
HTML DOM reference: onblur event
Element Object
Color Picker