UPDATE
It has been a while since I posted this answer, and now everything has changed:
$(document).on('click', '.click', function() { });
Since jQuery 1.7+ should use the new .on() and .live() deprecated. General rule:
- Do not use
.live() if your jQuery version does not support .delegate() . - Do not use
.delegate() if your jQuery version does not support .on() .
Also check this criterion to see the difference in performance, and you will see why you should not use .live() .
Below is my original answer:
use delegate or live
$('.click').live('click', function(){ });
or
$('body').delegate('.click', 'click', function() { });
Peeehaa
source share