jquery1.10 removes the .live() method and adds a new .on() method to bind events to elements. The specific usage is as follows:
on(events,[selector],[data],fn )
$("#dataTable tbody tr").on ("click", function(event){
alert($(this).text());
});
The above method binds all tr The event is set, but the event cannot be bound to the newly added element.
$("#dataTable tbody").on(" click", "tr", function(event){
alert($(this).text());
});
The above method binds tbody An event is generated, and if the tr in it is a new element, the click event can be triggered uniformly.