Remove event handlers.
The .die() method is used to remove event handlers from elements that were previously attached using the
- Without any parameters the
.die()method unattaches all event handlers previously attached using the
- For the
.die()method to function correctly the selector used must exactly match the selector used when attaching the handlers using the
- Starting with jQuery version 1.7 more flexible event delegation can be achieved by using the
.on()method allows us to attach event handlers directly to a document and is the preferred method to use when using this version onwards.
This method was deprecated in jQuery 1.7 and removed in jQuery 1.9 and we are just showing it for completeness.
|.die()||Remove all handlers attached with the |
|.die( eventType [, handler] )||Remove an event handler previously attached using the |
|.die( eventTypes )||A map of event type(s) and previously bound functions attached with the |
|eventType||A string containing one or more DOM event types or custom event names.
|handler||A function to unattach from.|
|eventTypes||An object of event type(s) and previously bound functions to unattach from.|