-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
25 lines (21 loc) · 853 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { calculateTax } from './taxCalculator.js';
$(document).ready(function () {
$("#range-s").val(0)
$('#valBox').val(0)
$("#range-s").on('input', function (event) {
event.preventDefault()
$("#valBox").val(event.target.value)
});
$("#valBox").on('input', function () {
$("#range-s").val($("#valBox").val())
})
$(".calculate").click(function () {
$(".tax-table").css("display", "block")
var taxable_income = Number($("#valBox").val());
var tax = calculateTax(taxable_income);
$("#tax-perc").text((tax * 100 / taxable_income).toFixed(2));
$("#final-amount").text(tax.toLocaleString("en-US"));
$("#cal-value").text(taxable_income.toLocaleString("en-US"));
$("#tax-due").text(tax.toLocaleString("en-US"));
})
});