initCompositionEvent method
Initializes a new text composition event that the createEvent method created.
createEvent()/initEvent() constructor pattern for synthetic events is deprecated. See the Synthetic Events page for more information.![]() ![]() |
Syntax
var retval = CompositionEvent.initCompositionEvent(eventType, canBubble, cancelable, viewArg, data, locale);Parameters
- eventType [in]
-
Type: String
One of the following values, or a user-defined custom event type.
-
Text input is complete. If character data is available, this event is followed by a
textInputevent with the appropriate inputMethod value. -
A text input system starts composing a passage of text.
-
New characters are added to the data attribute. This event is optional depending on the input method.
- canBubble [in]
-
Type: Boolean
- cancelable [in]
-
Type: Boolean
- viewArg [in]
-
Type: IHTMLWindow2
The active window object or null. This value is returned in the view attribute of the event. - data [in]
-
Type: String
The composition data. This value is returned in the data attribute of the event.
- locale [in]
-
Type: String
The locale name. This value is returned in the locale attribute of the event.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Standards information
- Document Object Model (DOM) Level 3 Events Specification, Section 5.2.7
See also

