jQuery die() Method

jQuery die() method is used to removes one or more event handlers, used with the live() method, for the selected elements.

The die() method was deprecated in jQuery 1.7. and removed om jQuery 1.9.


This syntax represent to the die event

$(selector).die(eventType, function);
Parameter Type Description
eventType String Required. Specifies one or more DOM event types (such as "click" or "dblclick" or custom event names) to attach to the elements
function Function Optional. Specifies the function to execute when the event is occurs


This example represent the die event, once die event trigger it will remove event handles on the selected elements.

<!DOCTYPE html>
  <title>jQuery die() method</title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
      $("p").live("click", function(){
    <p>first paragraph text</p>
    <p>second paragraph text</p>
  <button>Click here to remove above p element "click" event handler</button>

Run it...   »