-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
49 lines (39 loc) · 2.06 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
<!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>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1 class="heading1">Simple Calculator</h1>
<div class="formstyle">
<form name = "forms">
<input class="ans" type="text" name="answer"> <br></br><br></br>
<input type="button" value=" 1 " onclick="forms.answer.value += '1' ">
<input type="button" value=" 2 " onclick="forms.answer.value += '2' ">
<input type="button" value=" 3 " onclick="forms.answer.value += '3' ">
<br></br>
<input type="button" value=" 4 " onclick="forms.answer.value += '4' ">
<input type="button" value=" 5 " onclick="forms.answer.value += '5' ">
<input type="button" value=" 6 " onclick="forms.answer.value += '6' ">
<br></br>
<input type="button" value=" 7 " onclick="forms.answer.value += '7' ">
<input type="button" value=" 8 " onclick="forms.answer.value += '8' ">
<input type="button" value=" 9 " onclick="forms.answer.value += '9' ">
<br></br>
<input type="button" value=" + " onclick="forms.answer.value += '+' ">
<input type="button" value=" - " onclick="forms.answer.value += '-' ">
<input type="button" value=" * " onclick="forms.answer.value += '*' ">
<br></br>
<input type="button" value=" / " onclick="forms.answer.value += '/' ">
<input type="button" value=" 0 " onclick="forms.answer.value += '0' ">
<input type="button" value=" = " onclick="forms.answer.value = eval(forms.answer.value) ">
<br></br>
<input class="btn" type="button" value="Clear All" onclick="forms.answer.value = ' ' " id="clear">
</form>
</div>
</body>
</html>