jquery - Can i fire or execute a javascript function on the change of class on object? -


i want execute function when element 's class updated (any new class add or remove).

how can in jquery

you'll need set custom event.

//function receive event $('#foo').bind('class_change', function() {       alert("class changed");     });  //use trigger() fire custom event $('#foo').addclass("newclass").trigger('class_change');  $('#foo').removeclass("newclass").trigger('class_change'); 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -