-
Notifications
You must be signed in to change notification settings - Fork 0
/
one.js
122 lines (118 loc) · 3.51 KB
/
one.js
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
function button16(){
document.getElementById("input").value = "";
document.getElementById("h3").innerHTML = "";
}
function button(){
document.getElementById("input").value += "7";
document.getElementById("h3").innerHTML += "7";
}
function buttontwo(){
document.getElementById("input").value += "8";
document.getElementById("h3").innerHTML += "8";
}
function buttonthree(){
document.getElementById("input").value += "9";
document.getElementById("h3").innerHTML += "9";
}
function buttonfour(){
document.getElementById("input").value += "÷";
document.getElementById("h3").innerHTML += "/";
}
function buttonfive(){
document.getElementById("input").value += "4";
document.getElementById("h3").innerHTML += "4";
}
function buttonsix(){
document.getElementById("input").value += "5";
document.getElementById("h3").innerHTML += "5";
}
function buttonseven(){
document.getElementById("input").value += "6";
document.getElementById("h3").innerHTML += "6";
}
function button8(){
document.getElementById("input").value += "X";
document.getElementById("h3").innerHTML += "*";
}
function buttonnine(){
document.getElementById("input").value += "1";
document.getElementById("h3").innerHTML += "1";
}
function buttonten(){
document.getElementById("input").value += "2";
document.getElementById("h3").innerHTML += "2";
}
function button11(){
document.getElementById("input").value += "3";
document.getElementById("h3").innerHTML += "3";
}
function buttontwelve(){
document.getElementById("input").value += "+";
document.getElementById("h3").innerHTML += "+";
}
function button13(){
document.getElementById("input").value += "0";
document.getElementById("h3").innerHTML += "0";
}
function button14(){
document.getElementById("input").value += ".";
document.getElementById("h3").innerHTML += ".";
}
function minus(){
document.getElementById("input").value += "-";
document.getElementById("h3").innerHTML += "-";
}
function suraj(){
var four = document.getElementById("buttonfour").value;
var five = document.getElementById("button8").value;
var six = document.getElementById("buttontwelve").value;
}
function button15(){
var x = document.getElementById("h3").innerHTML;
var y = eval(x);
if (x == "0/0"){
document.getElementById("input").value = "This Can't Be Happen";
}
else if (x == "3/0"){
document.getElementById("input").value = "This Can't Be Happen"
}
else if (x == "4/0"){
document.getElementById("input").value = "This Can't Be Happen"
}
else if (x == "5/0"){
document.getElementById("input").value = "This Can't Be Happen"
}
else if (x == "6/0"){
document.getElementById("input").value = "This Can't Be Happen"
}
else if (x == "7/0"){
document.getElementById("input").value = "This Can't Be Happen"
}
else if (x == "8/0"){
document.getElementById("input").value = "This Can't Be Happen"
}
else if (x == "9/0"){
document.getElementById("input").value = "This Can't Be Happen"
}
else if (x == "2/0"){
document.getElementById("input").value = "This Can't Be Happen"
}
else if (x == "1/0"){
document.getElementById("input").value = "This Can't Be Happen";
}
else if (x == "1+"){
document.getElementById("input").value = "OnePlus 5G"
}
else {
document.getElementById("input").value = y;
}
}
document.getElementById("h3").style.display = "none";
function back(){
var a = document.getElementById("input").value;
var b = a.substr(0,a.length-1);
document.getElementById("input").value = b;
var x = document.getElementById("h3").innerHTML;
var c = x.substr(0,x.length-1);
document.getElementById("h3").innerHTML = c;
}