forked from katelyn98/WiCS-Dynamic-Website-Tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
34 lines (22 loc) · 659 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
26
27
28
29
30
31
32
33
34
'use strict'
const switcher = document.querySelector('.btn');
// button event listener
switcher.addEventListener('click', function() {
document.body.classList.toggle('dark-theme')
var className = document.body.className;
if(className == "light-theme") {
this.textContent = "Dark";
}
else {
this.textContent = "Light";
}
});
// form function
function myFunction() {
var x, text;
//Finish the function
// Get the value of the input field with id="teamname"
x = document.getElementById("teamname").value;
text = "Your team name idea is " + x;
document.getElementById("formbtn").innerHTML = text;
}