forked from 0xvashishth/CalcHub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
104 lines (96 loc) · 3.14 KB
/
index.html
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Income Tax Calculator</title>
<style>
article,
aside,
figure,
footer,
header,
nav,
section {
display: block;
}
body {
font-family: Arial, Helvetica, sans-serif;
background-color: #2a86ba;
margin: 100px auto;
width: 500px;
border: 3px solid black;
}
h1 {
color: white;
margin-top: 0;
}
section {
padding: 1em 2em;
}
label {
float: left;
width: 10em;
text-align: right;
}
input {
margin-left: 1em;
margin-bottom: .5em;
}
</style>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<script>
var $ = function(id) {
return document.getElementById(id);
}
var calculate_tax = function() {
var total;
var income = parseFloat($("income").value);
$("tax").value = calcTaxes(income);
console.log(tax);
function calcTaxes(amount) {
var max2colors = 0;
if (amount <=500000) {
tax = 0;
} else if (amount <=750000) {
tax = (250000*0.05)+((amount-500000)*0.1);
} else if (amount <=1000000) {
tax = (250000*0.05)+(250000*0.1)+((amount-750000)*0.15);
}
else if (amount <=1250000) {
tax = (250000*0.05)+(250000*0.1)+(250000*0.15)+((amount-1000000)*0.2);
}
else if (amount <=1500000) {
tax = (250000*0.05)+(250000*0.1)+(250000*0.15)+(250000*0.2)+((amount-1250000)*0.25)
}
else {
tax = (250000*0.05)+(250000*0.1)+(250000*0.15)+(250000*0.2)+(250000*0.25)+((amount-1500000)*0.3)
}
// tax += amount * .153;
return parseInt(tax + tax*0.04);
/*
upto RS 2.5 lakhs--NIL
from RS 250001 to 5 lakh--5% [If an individual has a salary which is less than 5 lakh then he/she gets a Rebate discount of RS 12500 ,So ending up the tax for that person to be Zero]
from RS 500001 to 7.5 lakh--10%
from RS 750001 to 10 lakh--15%
from RS 1000001 to 12.5 lakh--20%
from RS 1250001 to 15 lakh--25%
from RS 1500001 and above--30%
*/
}
}
window.onload = function() {
$("max2colors").onclick = calculate_tax;
}
</script>
</head>
<body>
<section>
<h1>Income Tax Calculator</h1>
<label>Enter taxable income:</label>
<input type="text" id="income" />
<input type="button" value="calculate" name="max2colors" id="max2colors" /><br><br>
<label>Income tax owed:</label>
<input type="text" id="tax"><br>
</section>
</body>
</html