jQuery .live function removed in V 1.9. What is the best replacement for .live function ?

Read {count} times since 2020

As of jQuery version 1.9, the .live function has been removed which means it is no longer available to use. Instead of this function you can use .on function which also has the same function as .live

Both of them attach an event handler for all elements which match the current selector, now and in the future.

Since .live has been removed you can use .on function. Here’s how we should do it.
Replace .live function with .on. It’s that simple.

$("#dataTable tbody tr").live("click", function(event){

With :

$("#dataTable tbody tr").on("click", function(event){

Use a software such as regexxer to replace all .live( word with .on( word.

Show Comments