-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
35 lines (35 loc) · 1.47 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
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<br><br>
<center>
<form name="calc">
<input type="text" name="txt">
<br><br>
<input type="button" value="9" onclick="document.calc.txt.value += 9">
<input type="button" value="8" onclick="document.calc.txt.value += 8">
<input type="button" value="7" onclick="document.calc.txt.value += 7">
<input type="button" value="+" onclick="document.calc.txt.value += '+'">
<br>
<input type="button" value="6" onclick="document.calc.txt.value += 6">
<input type="button" value="5" onclick="document.calc.txt.value += 5">
<input type="button" value="4" onclick="document.calc.txt.value += 4">
<input type="button" value="-" onclick="document.calc.txt.value += '-'">
<br>
<input type="button" value="3" onclick="document.calc.txt.value += 3">
<input type="button" value="2" onclick="document.calc.txt.value += 2">
<input type="button" value="1" onclick="document.calc.txt.value += 1">
<input type="button" value="*" onclick="document.calc.txt.value += '*'">
<br>
<input type="button" value="/" onclick="document.calc.txt.value += '/'">
<input type="button" value="C" onclick="document.calc.txt.value = ''">
<input type="button" value="X" onclick="document.calc.txt.value = document.calc.txt.value.slice(0,document.calc.txt.value.length - 1)">
<input type="button" value="=" onclick="document.calc.txt.value = eval(document.calc.txt.value)">
<br>
</form>
</center>
<script src="script.js"></script>
</body>
</html>