THE WORLD'S LARGEST WEB DEVELOPER SITE

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

HTMLElementObject.blur()

Parameters

None

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