I have a live()
function in my jquery below:
$("#qandatbl td.weight input").live("change", calculateTotal); function calculateTotal() { var totalweight = hundred; $("#qandatbl td.weight input").each(function (i, elm){ totalweight = totalweight - parseInt($(elm).val(), 10); }); $("#total-weight").text(totalweight).append('%').css('font-weight', 'bold'); }
Now some say that the live()
function is slowing down and it is better to use the on()
function. If so, then how do I change the above code to on()
and not to the live()
function? Is it important that I do not use live()
or is it not a big deal?
Bruceybandit
source share