forked from ArjunVaskale/html_program
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsijquery.html
More file actions
54 lines (53 loc) · 1.75 KB
/
sijquery.html
File metadata and controls
54 lines (53 loc) · 1.75 KB
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
<html>
<head>
<title>Simple Interest Calculation</title>
<script type="text/javascript" src="F:\avani\html\jquery.txt"></script>
</head>
<body>
<form id="myForm">
<table border = "0" width = 300px>
<tr>
<td>
Amount:
</td>
<td>
<input type="text" id="p">
</td>
</tr>
<tr>
<td>
Rate:
</td>
<td>
<input type="text" id="r">
</td>
</tr>
<tr>
<td>
No. of Years:
</td>
<td>
<input type="text" id="t">
</td>
</tr>
</table>
</form>
<button id="calculate">Calculate</button> <button id="clear">Clear</button>
<p id="result"></p>
</body>
<script>
$(document).ready(function(){
$("#calculate").click(function(){
var p = $("#p").val();
var r = $("#r").val();
var t = $("#t").val();
var result = ((+p) * (+t) * (+r)) / 100;
$("#result").html("Amount is "+ p +"<br>Rate is "+ r +"<br>Time is "+ t +"<br>The interest is " + result);
});
$("#clear").click(function(){
$("#myForm").closest('form').find("input[type=text], textarea").val("");
$("#result").html("");
});
});
</script>
</html>