Availability
DOM Level 2 Events
Synopsis
Event createEvent(String eventType)
throws DOMException;
Arguments
eventType
The name of the event module for which an Event object is desired.
See the Section section for a list of valid event
types.
Returns
A newly created Event object of the specified type.
Throws
This method throws a DOMException with a code of
NOT_SUPPORTED_ERR if the implementation does not
support events of the requested type.
Description
This method creates a new event type of the type specified by the
eventType argument. Note that the value of
this argument should not be the (singular) name of the event
interface to be created, but instead should be the (plural) name of
the DOM module that defines that interface. The following table shows
the legal values for eventType and the
event interface each value creates.
eventType argument | Event interface | Initialization method |
|---|---|---|
HTMLEvents | Event | initEvent( ) |
MouseEvents | MouseEvent | initMouseEvent( ) |
UIEvents | UIEvent | initUIEvent( ) |
MutationEvents | MutationEvent | initMutationEvent( ) |
the object with the initialization method shown in the table. See the
appropriate Event interface reference page for details about the
initialization method.
This method is actually defined not by the Document interface but by
the DocumentEvent interface. If an implementation supports the Events
module, the Document object always implements the DocumentEvent
interface and supports this method.
See Also
Event, MouseEvent, MutationEvent, UIEvent
•
Table of Contents
•
Index
•
Reviews
•
Examples
•
Reader Reviews
•
Errata
JavaScript: The Definitive Guide, 4th Edition
By
David Flanagan
Publisher
: O'Reilly
Pub Date
: November 2001
ISBN
: 0-596-00048-0
Pages
: 936
Slots
: 1
This fourth edition of the definitive reference to
JavaScript, a scripting language that can be embedded
directly in web pages, covers the latest version of the
language, JavaScript 1.5, as supported by Netscape 6 and
Internet Explorer 6. The book also provides complete
coverage of the W3C DOM standard (Level 1 and Level 2),
while retaining material on the legacy Level 0 DOM for
backward compatibility.