-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcalculator.html
More file actions
70 lines (52 loc) · 1.88 KB
/
Copy pathcalculator.html
File metadata and controls
70 lines (52 loc) · 1.88 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html>
<head>
<title>vaniila</title>
</head>
<body>
<input type="text" style="width: 600px; height: 100px;" name="output" id="output"> <br> <br>
<button id="submit" onclick="getval(1);">1</button>
<button id="submit" onclick="getval(2);">2</button>
<button id="submit" onclick="getval(3);">3</button>
<button id="submit" onclick="getval(4);">4</button>
<button id="submit" onclick="getval(5);">5</button>
<button id="submit" onclick="getval(6);">6</button>
<button id="submit" onclick="getval(7);">7</button>
<button id="submit" onclick="getval(9);">9</button>
<button id="submit" onclick="getval(0);">0</button>
<br> <br>
<button id="divide" value="/" onclick="getval('/')">/</button>
<button id="del" value="del" onclick="deleted(del)">DEL</button>
<br> <br>
<button id="submit" onclick="cleared();">clear</button>
<button id="multiply" value="*" onclick="getval('*')">x</button>
<button id="percent" value="%" onclick="getval('%')">%</button>
<button id="divide" value="/" onclick="getval('/')">/</button>
<button id="del" value="del" onclick="deleted(del)">DEL</button>
<button id="equal" value="=" onclick="getval('=')">=</button>
<button id="substrct" value="-" onclick="getval('-')">-</button>
<button id="plus" value="+" onclick="getval('+')">+</button>
<script type="text/javascript" src="js/framework.js"></script>
<script type="text/javascript">
var screen=$id('output');
screen.value = 0;
// console.log(screen);
function getval(a){
getvalue = screen.value += a;
if(a=="="){
let questarray = getvalue.match(/[^\d()]+|[\d.]+/g);
for (var i = 0; i < questarray.length; i++) {
console.log(questarray[i]); //you can figure it out your self now cheers!!!!
}
// questarray);
}
}
function deleted(){
}
function cleared(){
screen.value = 0;
// console.log('cleared');
}
</script>
</body>
</html>