-
Notifications
You must be signed in to change notification settings - Fork 0
/
sum.html
62 lines (57 loc) · 1.93 KB
/
sum.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
<html>
<head>
<SCRIPT language="JavaScript">
var total = 0;
function sum() {
document.f1.rez.value = Number(document.f1.op1.value) + Number(document.f1.op2.value);
}
function inputnum(arg) {
document.f1.result.value += arg;
}
function plus() {
total += Number(document.f1.result.value);
document.f1.result.value = "";
}
function getresult() {
total += Number(document.f1.result.value);
document.f1.result.value = total;
}
function clearq() {
total = 0;
document.f1.result.value = "";
}
</SCRIPT>
</head>
<body>
<center><h1>Ñóììà</h1>
<form name="f1">
<input name="result" size="50" type="text" value="">
</form>
<table>
<tr>
<td><input onclick="inputnum(this.value)" type="button" value="1"></td>
<td style="background-color: white"><input onclick="inputnum(this.value)" type="button" value="2"></td>
<td><input onclick="inputnum(this.value)" type="button" value="3"></input></td>
</tr>
<tr>
<td style="background-color: white"><input onclick="inputnum(this.value)" type="button" value="4"></input></td>
<td><input onclick="inputnum(this.value)" type="button" id="myButton5" value="5"></input></td>
<td style="background-color: white"><input onclick="inputnum(this.value)" type="button" value="6"></input></td>
</tr>
<tr>
<td><input onclick="inputnum(this.value)" type="button" value="7"></input></td>
<td style="background-color: white"><input onclick="inputnum(this.value)" type="button" value="8"></input></td>
<td><input onclick="inputnum(this.value)" type="button" value="9"></input></td>
</tr>
<tr>
<td><input type="button" value="+" onClick="plus()"></input></td>
<td><input type="button" onclick="inputnum(this.value)" value="0"></input></td>
<td><input type="button" value="=" onclick="getresult(this.value)"></input></td>
</tr>
<tr>
<td><input type="button" value="c" onClick="clearq()"></td>
</tr>
</table>
</center>
</body>
</html>