web api constructor
InputEvent: InputEvent() constructor
The InputEvent() constructor creates a new InputEvent object.
Syntax
new InputEvent(type)
new InputEvent(type, options)
Parameters
type- : A string with the name of the event.
It is case-sensitive and browsers set it to
beforeinput, orinput.
- : A string with the name of the event.
It is case-sensitive and browsers set it to
optionsOptional- : An object that, in addition of the properties defined in
UIEvent(), can have the following properties:inputTypeOptional- : A string specifying the type of change for editable content such as, for example, inserting, deleting, or formatting text.
dataOptional- : A string containing characters to insert. This may be an empty string if the change doesn’t insert text (such as when deleting characters, for example).
isComposingOptional- : A boolean indicating that the event is part of a composition session,
meaning it is after a
compositionstartevent but before acompositionendevent. The default isfalse.
- : A boolean indicating that the event is part of a composition session,
meaning it is after a
- : An object that, in addition of the properties defined in
Return value
A new InputEvent object.
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.
See also
InputEvent, the interface of the objects it constructs.