Web/API/FocusEvent/FocusEvent

From Get docs


The FocusEvent() constructor returns a newly created FocusEvent object with an optional EventTarget. When the event has both a source and a destination, the relatedTarget value must be set to the other target.

Syntax

var focusEvent = new FocusEvent(typeArg[, focusEventInit]);

Properties

The FocusEvent() constructor also inherits arguments from UIEvent() and from Event().

typeArg
Is a DOMString representing the name of the event.
focusEventInit Optional
Is a FocusEventInit dictionary, having the following fields:
  • "relatedTarget", optional and defaulting to null, is an EventTarget representing the secondary target of a FocusEvent.

The FocusEventInit dictionary also accepts fields from the UIEventInit and EventInit dictionaries.

Specifications

Specification Status Comment
Document Object Model (DOM) Level 3 Events SpecificationThe definition of 'FocusEvent()' in that specification. Obsolete Initial definition

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet

FocusEvent() constructor

Experimental'

Chrome

Full support Yes

Edge

Full support ≤18

Firefox

Full support 24

IE

No support No

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

Full support 24

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

Legend

Full support  
Full support
No support  
No support
Experimental. Expect behavior to change in the future.'
Experimental. Expect behavior to change in the future.


See also