jQuery > Events

Double click event in jQuery

How to attach double click event to a html element in jQuery?


To attach double click event to an element, dblclick() method can be used that fires when the element is double clicked.

  <script>
        $("#btnDblClick").dblclick(function () {
           alert("dblclick event called");
       });
  </script>

Above code snippet find html element whose id is "btnDblClick" and attaches dblclick event. When this element is double clicked, the attached function executes that shows "dblclick event called" message in the JavaScript alert box.

 Views: 6326 | Post Order: 63



Write for us






Hosting Recommendations