Skip to content Skip to sidebar Skip to footer

How To Expand Matematic Formulas In Output Html Element

I have three fields in which one is earn amount and second one is tax deduction and third one is amount payable.Now its displaying for me the value of tax which is deducted from

Solution 1:

You can easily do this using Jquery.

$(function() {
  return $('#earnamount, #taxdeduction').change(function() {
    var earn_amount, tax_rate, tax_total, total;
    earn_amount = parseFloat($('#earnamount').val());
    tax_rate = parseFloat($('#taxdeduction').val());
    tax_total = earn_amount * tax_rate;
    total = earn_amount - tax_total;
    $('#amountpayable').val(total);
    return $('output[name="amount"]').text(tax_total);
  });
});

Check out this fiddle

Post a Comment for "How To Expand Matematic Formulas In Output Html Element"