Favorites

DOM HTMLElement.blur() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
HTMLElement.blur()
DOM HTMLElement MethodThis method is supported by all modern browsers.
Updated 28th November 2026

The blur() method removes keyboard focus from an element.

Description

The blur() method removes keyboard focus from the element, if it has it. Focus moves to the document body. It's rarely needed and can disorient keyboard users; moving focus to a sensible next element with focus() is usually better.

Removing focus also triggers the element's blur and focusout events, which are commonly used to validate a field once the user moves on. Calling blur() on an element that doesn't have focus does nothing.

Avoid using it to hide focus outlines after a click; the :focus-visible CSS pseudo-class lets you show focus styles only for keyboard users while keeping focus where it is, which is much better for accessibility.

Syntax

element.blur()

Return Value

None (undefined).

Example

<input value="Focus me">
const input = document.querySelector('input');
input.focus();
console.log(document.activeElement === input);
input.blur();
console.log(document.activeElement.tagName);

Browser Support

The following information will show you the current browser support for the HTMLElement.blur() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee