files/en-us/web/api/compositionevent/initcompositionevent/index.md
{{deprecated_header}}{{APIRef("UI Events")}}
The initCompositionEvent()
method of the {{domxref("CompositionEvent")}} interface initializes the attributes of a
CompositionEvent object instance.
[!NOTE] The correct way of creating a {{domxref("CompositionEvent")}} is to use the constructor {{domxref("CompositionEvent.CompositionEvent", "CompositionEvent()")}}.
initCompositionEvent(type, canBubble, cancelable, view, data, locale)
type
compositionstart, compositionupdate, or
compositionend.canBubble
cancelable
view
data
data
attribute.locale
locale
attribute.None ({{jsxref("undefined")}}).
{{Specifications}}
{{Compat}}