forked from DevMountain/vanillajs-1-mini
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
39 lines (26 loc) · 749 Bytes
/
index.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
console.log("Hello world")
let count = 0;
let counterDisplay = document.getElementById('counter')
function increase() {
count++;
// console.log(count);
counterDisplay.innerText = count;
}
function decrease() {
count--;
counterDisplay.innerText = count;
// console.log(count);
}
function reset() {
count = 0;
counterDisplay.innerHTML = `<mark>${count}</mark>`;
// console.log(count);
}
function selectTheme (theme) {
document.getElementsByTagName('body')[0].className = theme
document.getElementsByTagName('main')[0].className = theme
let buttons = document.getElementsByTagName('button')
for (let i = 0; i < buttons.length; i++) {
buttons[i].className = theme;
}
}