FocusEvent
Baseline Widely available
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
.
Constructor
FocusEvent()
-
Creates a
FocusEvent
event with the given parameters.
Instance properties
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 tonull
for security reasons.
Instance methods
Order of events
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 theblur
event.focus
: sent after element B receives focus.focusin
: sent after thefocus
event.
Specifications
Specification |
---|
UI Events # interface-focusevent |
Browser compatibility
BCD tables only load in the browser
See also
- The
Event
base interface