generated from microverseinc/readme-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
25 lines (23 loc) · 970 Bytes
/
app.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
(function () {
[...document.querySelectorAll(".control")].forEach(button => {
button.addEventListener("click", function() {
document.querySelector(".active-btn").classList.remove("active-btn");
this.classList.add("active-btn");
document.querySelector(".active").classList.remove("active");
document.getElementById(button.dataset.id).classList.add("active");
})
});
document.querySelector(".theme-btn").addEventListener("click", () => {
document.body.classList.toggle("light-mode");
})
})();
// const input1 = document.querySelector('form')[0]
// const input2 = document.querySelector('form')[1]
// const message = document.querySelector('form')[2]
// const submit = document.querySelector('.submit-btn')
// submit.addEventListener( 'submit', (e) => {
// e.preventDefault()
// input1.value = ''
// input2.value = ''
// message.value = ''
// })