i have the below code:
var LabourItems = {
rate: null,
hours: null,
total: null,
init: function(object) {
var rate = $(object).children('.rate').first();
var hours =$(object).children('.hours').first();
total = rate * hours;
updateTotal(object,total);
},
updateTotal: function(object, total) {
$(object).children('.total').first().attr('value', total)
}
}
//reactTochange for those inputs that you want to observe
$('.hours').live("click", function() {
jQuery.each($('.labouritems'), function(key,value){
LabourItems.init(value);
});
});
and geting an undefined function error:
updateTotal(object, total) is undefined
Could you please let me know what i'm doing wrong.