[Solved] calculate the dynamic values of rate * quantity [closed]
Give your table and “Get Total” button an ID: <table id=”cart”> <input id=”calculateTotal” type=”button” value=”Get Total” /> Put this script in the <head> of your page: $(function() { $(‘#calculateTotal’).click(function() { var total = 0; $(‘#cart tr:gt(0)’).each(function() { total += parseFloat($(this).find(‘td:eq(3)’).text()) * parseFloat($(this).find(‘input:last’).val()); }); // display total in textbox $(‘#total’).val(total); }); }); If you want to … Read more