HTML DOM Element blur() Method

Definition and Usage

blur() Method removes focus from the element.

See also:

HTML DOM Reference Manual:Element focus() Method

HTML DOM Reference Manual:onblur ɗanin

Instance

Example 1

Remove focus from text field:

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

Try it yourself

Example 2

Remove focus from <a> element:

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

Try it yourself

Syntax

HTMLElementObject.blur()

Parameter

None.

Return value

None.

Browser support

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

All browsers fully support it:

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