-
Notifications
You must be signed in to change notification settings - Fork 0
/
Index.html
46 lines (42 loc) · 2.33 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calculator</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Calculator</h1>
<form action="" id="display">
<input type="text" id="show" value="" placeholder="0">
<br>
<input type="button" id="sym" class="btn" value="AC" onclick="display.show.value =' ' ">
<input type="button" id="sym" class="btn" value="DEL" onclick="display.show.value = display.show.value.toString().slice(0, -1) ">
<input type="button" id="sym" class="btn" value="." onclick="display.show.value +='.' ">
<input type="button" id="sym" class="btn" value="%" onclick="display.show.value +='%' ">
<br>
<input type="button" class="btn" value="1" onclick="display.show.value +='1' ">
<input type="button" class="btn" value="2" onclick="display.show.value +='2' ">
<input type="button" class="btn" value="3" onclick="display.show.value +='3' ">
<input type="button" id="sym" class="btn" value="/" onclick="display.show.value +='/' ">
<br>
<input type="button" class="btn" value="4" onclick="display.show.value +='4' ">
<input type="button" class="btn" value="5" onclick="display.show.value +='5' ">
<input type="button" class="btn" value="6" onclick="display.show.value +='6' ">
<input type="button" id="sym" class="btn" value="*" onclick="display.show.value +='*' ">
<br>
<input type="button" class="btn" value="7" onclick="display.show.value +='7' ">
<input type="button" class="btn" value="8" onclick="display.show.value +='8' ">
<input type="button" class="btn" value="9" onclick="display.show.value +='9' ">
<input type="button" id="sym" class="btn" value="-" onclick="display.show.value +='-' ">
<br>
<input type="button" class="btn" value="00" onclick="display.show.value +='00' ">
<input type="button" class="btn" value="0" onclick="display.show.value +='0' ">
<input type="button" id="equal" class="btn" value="=" onclick="display.show.value = eval(display.show.value) ">
<input type="button" id="sym" class="btn" value="+" onclick="display.show.value +='+' ">
<br>
</form>
</body>
</html>