-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalculator.js
More file actions
44 lines (39 loc) · 1.04 KB
/
calculator.js
File metadata and controls
44 lines (39 loc) · 1.04 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
function dis(param){
document.getElementById("result").value+=param;
}
function clr(){
document.getElementById("result").value="";
}
function solve(){
var x=document.getElementById("result").value;
var y= document.getElementById("result").value=eval(x);
if(y===10){
document.getElementById("tab").style.backgroundColor="red";
}else{ document.getElementById("tab").style.backgroundColor="white";}
}
let trs = document.querySelectorAll("input");
console.log(trs)
for(let tr of trs){
tr.style.backgroundColor = mycolor()
}
function mycolor(){
let color = ["red","green","blue","pink","purple","orange"];
return color[Math.floor(Math.random()*color.length)]
}
document.getElementById("result").style.backgroundColor="white";
// function closure1(a){
// function closure2(b){
// return a / b
// }
// return closure2
// }
// console.log(closure1(8)(2));
// function wonderful(){
// let count = 1
// function wonder(){
// count++
// console.log(count);
// }
// setInterval(wonder, 1000)
// }
// wonderful()