It's no surprise that this one pops up often in JQuery questions.   .on() method attaches an event handler function for one or more events to selected elements. In the following code, the event handler function is attached to all the elements in the table with id “#dataTable” on both click and mouseover events. $('#dataTable tbody tr').on('click mouseover', function() {
console.log( $(this).text() );
}); It also delegates the events to the elements dynamically added to the page, in this case, the event handler function will be attached to the dynamically added elements.