mozilla

Revision 22779 of CustomEvent

  • Revision slug: DOM/Event/CustomEvent
  • Revision title: CustomEvent
  • Revision id: 22779
  • Created:
  • Creator: trevorh
  • Is current revision? No
  • Comment bug 427537; page created, 103 words added

Revision Content

Creates a new custom event through the DocumentEvent interface.

Syntax

document.customEvent(type, canBubble, cancelable, detail)
type
The type of event. Use a prefix to avoid conflicts with other custom and future event types.
canBubble
A boolean indicating whether the event should bubble up through the event chain or not (see {{ domxref("event.bubbles","bubbles") }}).
cancelable
A boolean indicating whether the event can be canceled (see {{ domxref("event.cancelable","cancelable") }}).
detail
Detail information about the {{ domxref("event") }}. May be null.

Specification

  • {{ spec("http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#interface-CustomEvent","DOM Level 3 Events : CustomEvent","WD") }}

Revision Source

<p>Creates a new custom event through the <code>DocumentEvent</code> interface.</p>
<h3>Syntax</h3>
<pre>document.customEvent(type, canBubble, cancelable, detail)
</pre>
<dl> <dt><code>type</code></dt> <dd>The type of event. Use a prefix to avoid conflicts with other custom and future event types.</dd> <dt><code>canBubble</code></dt> <dd>A boolean indicating whether the event should bubble up through the event chain or not (see {{ domxref("event.bubbles","bubbles") }}).</dd> <dt><code>cancelable</code></dt> <dd>A boolean indicating whether the event can be canceled (see {{ domxref("event.cancelable","cancelable") }}).</dd> <dt><code>detail</code></dt> <dd>Detail information about the {{ domxref("event") }}. May be null.</dd>
</dl>
<h3>Specification</h3>
<ul> <li>{{ spec("http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#interface-CustomEvent","DOM Level 3 Events : CustomEvent","WD") }}</li>
</ul>
Revert to this revision