.die()Returns: jQueryversion deprecated: 1.7, removed: 1.9

Description: Remove event handlers previously attached using .live() from the elements.

Any handler that has been attached with .live() can be removed with .die(). This method is analogous to calling .off() with no arguments, which is used to remove all handlers attached with .on(). See the discussions of .live() and .off() for further details.

If used without an argument, .die() removes all event handlers previously attached using .live() from the elements.

As of jQuery 1.7, use of .die() (and its complementary method, .live()) is not recommended. Instead, use .off() to remove event handlers bound with .on()

Note: In order for .die() to function correctly, the selector used with it must match exactly the selector initially used with .live().

Examples:

Example: To unbind all live events from all paragraphs, write:

1
$("p").die()

Example: To unbind all live click events from all paragraphs, write:

1
$("p").die( "click" )

Example: To unbind just one previously bound handler, pass the function in as the second argument:

1
2
3
4
5
6
7
var foo = function () {
// code to handle some kind of event
};
$("p").live("click", foo); // ... now foo will be called when paragraphs are clicked ...
$("p").die("click", foo); // ... foo will no longer be called.