HTML DOM Element blur() Method

Definition and Usage

blur() The method removes focus from the element.

See also:

HTML DOM Reference Manual:Element focus() Method

HTML DOM Reference Manual:onblur Event

Example

Example 1

Remove focus from the text field:

document.getElementById("myText").blur();

Try it yourself

Example 2

Remove focus from the <a> element:

document.getElementById("myAnchor").blur();

Try it yourself

Syntax

HTMLElementObject.blur()

Parameter

None.

Return value

None.

Browser support

element.blur() It is a feature of DOM Level 2 (2001).

All browsers fully support it:

Chrome IE Edge Firefox Safari Opera
Chrome IE Edge Firefox Safari Opera
Support 9-11 Support Support Support Support