You are here: Reference > JavaScript > client-side > event handling > methods

Event methods

Event creation and initialization methods:
Property Support Description
createEvent
(document, XMLDocument)
9
Creates an event object with the specified type.
createEventObject
(document)
Creates an event object for message sending.
initDragEvent
(event)
9
Initializes an event object created by the createEvent method with type of 'DragEvent'.
initEvent
(event)
9
Initializes an event object created by the createEvent method.
initKeyEvent
(event)
Initializes an event object created by the createEvent method with type of 'KeyboardEvent'.
initMessageEvent
(event)
9310.6
Initializes an event object created by the createEvent method with type of 'MessageEvent'.
initMouseEvent
(event)
9
Initializes an event object created by the createEvent method with type of 'MouseEvent'.
initMutationEvent
(event)
9
Initializes an event object created by the createEvent method with type of 'MutationEvent'.
initOverflowEvent
(event)
Initializes an event object created by the createEvent method with type of 'OverflowEvent'.
initTextEvent
(event)
9
Initializes an event object created by the createEvent method with type of 'TextEvent'.
initUIEvent
(event)
9
Initializes an event object created by the createEvent method with type of 'UIEvent'.
Event assigning methods:
Property Support Description
addEventListener
9
Registers an event handler function (event listener) for the specified event on the current object.
attachEvent
Registers an event handler function (event listener) for the specified event on the current object.
detachEvent
Removes the specified event handler from the current element that was registered earlier with the attachEvent method.
removeEventListener
9
Removes the specified event handler from the current element that was registered earlier with the addEventListener method.
Event raising methods:
Property Support Description
bubbleEvent
(external)
Dispatches the current standard event from a Scriptlet Component to the browser window.
dispatchEvent
9
Dispatches the specified event to the current element.
fireEvent
Initializes an event object and dispatches it to the current element.
getPreventDefault
(event)
Returns whether the default action of the current event is canceled or not.
postMessage
(window)
839.5
Provides communication between two documents regardless of their location.
preventDefault
(event)
9
Cancels the current event.
raiseEvent
(external)
Dispatches the specified custom event from a Scriptlet Component to the browser window.
stopPropagation
(event)
9
Disables the propagation of the current event in the DOM hierarchy.
Event capturing methods:
Property Support Description
captureEvents
(document, window)
3
Tells the document or window object to capture the specified types of events.
disableExternalCapture
(window)
3
Disables event capturing for documents that are located in different domains.
enableExternalCapture
(window)
3
Allows event capturing for documents that are located in different domains.
releaseCapture
Releases the mouse capture from the browser window that was previously set by the setCapture method and restores the normal event processing.
releaseEvents
(document, window)
3
Stops capturing the specified events that was previously set by the captureEvents method.
setCapture
Sets the current object to capture mouse events that occur within the entire browser window.
Event simulation methods:
Property Support Description
blur
Removes the focus from the current element, and fires the onblur event.
click
Simulates a mouse click on the current element.
doScroll
(body, div, html, span, textarea)
Simulates a mouse click on the specified scrollbar component of the current element.
dragDrop
Initiates a drag-and-drop operation.
focus
Sets the focus on the current element.
reset
(form)
Restores the contents of the elements contained by the current form to its original value.
setActive
Sets the element as the active element in the current document.
submit
(form)
Submits the data placed in the current form element.
Drag and drop methods:
Property Support Description
addElement
(dataTransfer)
3.5
Specifies the feedback image for the current drag-and-drop operation.
clearData
(dataTransfer)
3.5
Removes the specified formatted data from the current drag-and-drop operation.
getData
(dataTransfer)
3.5
Retrieves the specified formatted data from the current drag-and-drop operation.
mozClearDataAt
(dataTransfer)
3.5
Removes the specified formatted data associated to the dragged item at the specified position from the current drag-and-drop operation.
mozGetDataAt
(dataTransfer)
3.5
Retrieves the specified formatted data associated to the dragged item at the specified position from the current drag-and-drop operation.
mozSetDataAt
(dataTransfer)
3.5
Specifies the data, its format and the associated position for the current drag-and-drop operation.
mozTypesAt
(dataTransfer)
3.5
Returns a DOMStringList collection that contains the available data formats for the item at the specified position in the current drag-and-drop operation.
setData
(dataTransfer)
3.5
Specifies the data and its format for the current drag-and-drop operation.
setDragImage
(dataTransfer)
3.5
Specifies the feedback image and the mouse cursor position for the current drag-and-drop operation.
User Contributed Comments

Post Content

Post Content