UI Events
The initTextEventEvent() method of the TextEvent interface initializes the value of a TextEvent after it has been created.
This method must be called to set the event before it is dispatched, using EventTarget.dispatchEvent().
[!NOTE] In general, you won't create these events yourself; they are created by the browser.
Syntax
initTextEvent(type)
initTextEvent(type, bubbles)
initTextEvent(type, bubbles, cancelable)
initTextEvent(type, bubbles, cancelable, view)
initTextEvent(type, bubbles, cancelable, view, data)
Parameters
type- : A string to set the event's Event.type to.
There is only one event type for a TextEvent:
textInput.
- : A string to set the event's Event.type to.
There is only one event type for a TextEvent:
bubbles- : A boolean indicating whether or not the event can bubble.
falseby default. Sets the value of Event.bubbles.
- : A boolean indicating whether or not the event can bubble.
cancelable- : A boolean indicating whether or not the event's default action can be prevented.
falseby default. Sets the value of Event.cancelable.
- : A boolean indicating whether or not the event's default action can be prevented.
view- : The WindowProxy object from which the event was generated.
nullby default.
- : The WindowProxy object from which the event was generated.
data- : A string to set event's data attribute.
Return value
None (undefined).
Specifications
Browser compatibility
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
