UI Events
The CompositionEvent() constructor creates a new CompositionEvent object.
Syntax
new CompositionEvent(type)
new CompositionEvent(type, options)
Parameters
type- : A string with the name of the event.
It is case-sensitive and browsers set it to
compositionstart,compositionupdate, orcompositionend.
- : A string with the name of the event.
It is case-sensitive and browsers set it to
options- : An object that, in addition of the properties defined in UIEvent/UIEvent, has the following properties:
data- : A string used to initialize the CompositionEvent.data property of the new CompositionEvent. Browser-generated events set it to the characters generated by the IME composition.
- : An object that, in addition of the properties defined in UIEvent/UIEvent, has the following properties:
Return value
A new CompositionEvent object.
Specifications
Browser compatibility
See also
- CompositionEvent, the interface of the objects it constructs.
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
