removeEventListener method

This topic has not yet been rated - Rate this topic

Removes an event handler that the addEventListener method registered.

Document Object Model (DOM) Level 3 Events Specification, Section 4.3

Syntax

object.removeEventListener(type, listener, useCapture)

Parameters

type [in]

Type: String

The event type that the event handler is registered for.

listener [in]

Type: Object

The event handler function to remove.

useCapture [in]

Type: Boolean

A Boolean value that specifies the event phase to remove the event handler from:

true (true)

Remove the capturing phase event handler.

false (false)

Remove the bubbling phase event handler.

Return value

Type: HRESULT

This method can return one of these values.

Return codeDescription
S_OK

The operation completed successfully.

E_FAIL

The operation failed.

E_INVALIDARG

One or more arguments are invalid.

 

Standards information

Remarks

If you register multiple identical event handlers for the same event type, the duplicate event handlers are discarded. You can remove only the first instance.

If the arguments for removeEventListener do not identify a registered event handler, the call to removeEventListener has no effect.

See also

document
TextNode
window
XMLHttpRequest
AudioTrackList
addEventListener

 

 

Build date: 11/29/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.