-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
72 lines (67 loc) · 1.67 KB
/
main.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
var btn = document.querySelectorAll('button');
var outputArea = document.querySelector(".output_area");
if (outputArea.value>= 20) {
console.log(outputArea);
outputArea.innerHTML = " can not";
} else {
btn[0].onclick = function () {
outputArea.innerHTML = "";
}
btn[1].onclick = function () {
outputArea.innerHTML += this.innerText;
}
btn[2].onclick = function () {
outputArea.innerHTML += this.innerText;
}
btn[3].onclick = function () {
outputArea.innerHTML += this.innerText;
}
btn[4].onclick = function () {
outputArea.innerHTML += this.innerText;
}
btn[5].onclick = function () {
outputArea.innerHTML += this.innerText;
}
btn[6].onclick = function () {
outputArea.innerHTML += btn[6].innerText;
}
btn[7].onclick = function () {
outputArea.innerHTML += this.innerText;
}
btn[8].onclick = function () {
outputArea.innerHTML += this.innerText;
}
btn[9].onclick = function () {
outputArea.innerHTML += this.innerText;
}
btn[10].onclick = function () {
outputArea.innerHTML += this.innerText;
}
btn[11].onclick = function () {
outputArea.innerHTML += this.innerText;
}
btn[12].onclick = function () {
outputArea.innerHTML += this.innerText;
}
btn[13].onclick = function () {
outputArea.innerHTML += this.innerText;
}
btn[14].onclick = function () {
outputArea.innerHTML += this.innerText;
}
btn[15].onclick = function () {
outputArea.innerHTML += this.innerText;
}
btn[16].onclick = function () {
outputArea.innerHTML = "";
}
btn[17].onclick = function () {
outputArea.innerHTML += this.innerText;
}
btn[18].onclick = function () {
outputArea.innerHTML += this.innerText;
}
btn[19].onclick = function () {
outputArea.innerHTML = eval(outputArea.innerHTML);
};
}