Event methods
To react to user behavior, we need to register our handlers using these event methods. Note that many DOM events only apply to certain element types; these subtleties are not covered here. Event methods are discussed in detail in Chapter 3, Handling Events.
Binding
Event method |
Description |
---|---|
|
Binds |
|
Binds
|
|
Binds multiple handlers for events as specified in the |
|
Removes bindings on the element. |
|
Binds |
|
Binds
|
|
Removes the bindings on the element (for an event type, a particular handler, or all bindings). |
|
Binds
|
|
Binds a collection of handlers to be called when the given types of events are sent to a descendant element matching |
|
Removes the bindings on the element previously bound with |
Shorthand binding
Event method |
Description |
---|---|
|
Binds
|
|
Binds |
|
Binds |
|
Binds
|
|
Binds
|
|
Binds
|
|
Binds
|
|
Binds |
|
Binds
|
|
Binds
|
|
Binds
|
|
Binds
|
|
Binds
|
|
Binds
|
|
Binds
|
|
Binds |
|
Binds |
|
Binds |
|
Binds |
|
Binds |
|
Binds |
|
Binds |
|
Binds
|
|
Binds
|
|
Binds |
Triggering
Event method |
Description |
---|---|
|
Triggers handlers for the event on the element and executes the default action for the event. |
|
Triggers handlers for the event on the element without executing any default actions. |
Shorthand triggering
Event method |
Description |
---|---|
|
Triggers the
|
|
Triggers the
|
|
Triggers the
|
|
Triggers the
|
|
Triggers the |
|
Triggers the
|
|
Triggers the
|
|
Triggers the
|
|
Triggers the
|
|
Triggers the |
|
Triggers the
|
Utility
Event method |
Description |
---|---|
|
Creates a new function that executes with the given context. |