Possible Duplicate:
jquery on vs click methods
I have noticed some are saying to use “on” in the latest jQuery, but what is the difference and is it true I should use it?
$("#dataTable td").on("click", function(event){
alert($(this).text());
});
$("#dataTable td").click(function(event){
alert($(this).text());
});
None. Look here in the jQuery source. The .click() function is basically just an alias for .on(‘click’), the relevant code being this:
Although .click() is more concise I would recommend using .on if you want to be consistent, as it always was intended to unify event handling introduced with .bind, .live and the shorthand methods like .click.