Home  >  jQuery

Example of .delegate() in jQuery

April 30, 2013
.delegate() in jQuery associates handlers and events. For any DOM element .delegate() can attach handler like click to any event like any user defined function.Syntax is
Find the example.

<!DOCTYPE html>
p { color:blue; cursor:pointer;}
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<p>Click to test delegate.</p>
var i=0;
$("body").delegate("p", "click", function(){


©2022 concretepage.com | Privacy Policy | Contact Us