This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The FocusEvent interface represents focus-related events, including focus, blur, focusin, and focusout.
FocusEvent()Creates a FocusEvent event with the given parameters.
This interface also inherits properties from its parent UIEvent, and indirectly from Event.
An EventTarget representing a secondary target for this event. In some cases (such as when tabbing in or out a page), this property may be set to null for security reasons.
This interface has no specific methods. It inherits methods from its parent UIEvent, and indirectly from Event.
When focus is shifted from element A to element B, focus events are dispatched in the following order:
blur: sent after element A loses focus.focusout: sent after the blur event.focus: sent after element B receives focus.focusin: sent after the focus event.| Specification |
|---|
| UI Events> # interface-focusevent> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
FocusEvent |
26 | 12 | 24 | 15 | 7 | 26 | 24 | 14 | 7 | 1.5 | 4.4 | 7 |
FocusEvent |
26 | 12 | 24 | 15 | 7 | 26 | 24 | 14 | 7 | 1.5 | 4.4 | 7 |
relatedTarget |
26 | 12 | 24 | 15 | 7 | 26 | 24 | 14 | 7 | 1.5 | 4.4 | 7 |
Event base interface
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent