Posted By

secretgspot on 03/22/11


Tagged

Delegate


Versions (?)

.delegate()


 / Published in: jQuery
 

Instead of using for each element, parent can be assigned a global function for children. Also good with dynamically created elements.

  1. $("table").delegate("td", "hover", function(){
  2. $(this).toggleClass("hover");
  3. });

Report this snippet  

You need to login to post a comment.