-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
31 lines (24 loc) · 797 Bytes
/
script.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
let calc = "";
let btn = document.querySelectorAll('.btn');
Array.from(btn).forEach((btn)=>{
btn.addEventListener('click',(event)=>{
if(event.target.innerHTML == "AC"){
calc = "";
document.querySelector('input').value = calc ;
}
else if (event.target.innerHTML == '=') {
calc = eval(calc);
document.querySelector('input').value = calc;
}
else{
calc = calc + event.target.innerHTML;
document.querySelector('input').value = calc;
}
});
});
let lost = document.getElementsByClassName('in_active');
for (var i = 0; i < lost.length; i++) {
lost[i].addEventListener('click', ()=>{
alert('This feature is not available yet !!');
});
}