FocusEvent()

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

Browser compatibility

BCD tables only load in the browser

See also