-
Notifications
You must be signed in to change notification settings - Fork 1
/
popup.js
48 lines (36 loc) · 1.27 KB
/
popup.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
document.addEventListener('DOMContentLoaded', function () {
var button = document.querySelectorAll('button');
button[0].addEventListener('click', clickHandler);
button[1].addEventListener('click', clickHandler);
button[0].style.display = 'none';
button[1].style.display = 'none';
document.querySelector('label').addEventListener('click', display);
});
function clickHandler(element) {
var button = document.querySelectorAll('button');
if(button[0].style.backgroundColor === "#ff7e5e" || button[1].style.backgroundColor === "#ff7e5e")
{
this.style.backgroundColor = "white";
}
else
{
this.style.backgroundColor = "#ff7e5e";
}
}
function display(element) {
var button = document.querySelectorAll('button');
if (button[0].style.display === 'none' ){
button[0].style.display = 'inline';
button[1].style.display = 'inline';
}
/*else if (button[0].style.display === 'inline') {
button[0].style.display = 'none';
button[1].style.display = 'none';
}*/
/* button[0].style.display = 'none';
button[1].style.display = 'none';
}*/
//button[0].style.display = 'block';
//button[1].style.display = 'block';
//element.preventDefault();
}