EventTarget Class
Adds event emitter functionality to a class
Item Index
Properties
Methods
addEventListener
(
-
type -
listener
Adds a listener for a specific event
Parameters:
-
typeStringA string representing the event type to listen for.
-
listenerFunctionThe callback function that will be fired when the event occurs
dispatchEvent
(
-
event
Fires the event, ie pretends that the event has happened
Parameters:
-
eventEventthe event object
removeAllEventListeners
(
-
type
Removes all the listeners that were active for the specified event type
Parameters:
-
typeStringA string representing the event type which will have all its listeners removed
removeEventListener
(
-
type -
listener
Removes the specified listener that was assigned to the specified event type
Parameters:
-
typeStringA string representing the event type which will have its listener removed
-
listenerFunctionThe callback function that was be fired when the event occured
Properties
listeners
Object
Holds all the listeners
