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 tonull
, is anEventTarget
representing the secondary target of aFocusEvent
.
The
FocusEventInit
dictionary also accepts fields from theUIEventInit
andEventInit
dictionaries.
Specifications
Specification | Status | Comment |
---|---|---|
Document Object Model (DOM) Level 3 Events Specification The definition of 'FocusEvent()' in that specification. |
Obsolete | Initial definition |
Browser compatibility
BCD tables only load in the browser
See also
- The
FocusEvent
interface it belongs to.