javascript - jQuery Class is not adding after division refresh -


i have jquery code when button-refresh clicked, table-data table refreshed. when refreshed, class negative not adding td

below code

$("#button-refresh").click(function(){     $("#table-data").load("index.php #table-data");     $("td[name=td-total").each(function() {       var text = $(this).text();         var num = parsefloat(text);         if (num < 0) {           $(this).addclass("negative");         }     }); }); 

use callback method of .load()

$("#button-refresh").click(function(){   $("#table-data").load("index.php #table-data", function() {     $("td[name=td-total").each(function() {       var text = $(this).text();       var num = parsefloat(text);       if (num < 0) {         $(this).addclass("negative");       }     });   }); }); 

Comments

Popular posts from this blog

c++ - list<myClass<int> * > sort -

SoapUI on windows 10 - high DPI/4K scaling issue -

java - why am i getting a "cannot resolve method" error on getApplication? -