Update modeTheme.js
This commit is contained in:
parent
4b49a2ba2f
commit
9f9dc4eec3
1 changed files with 1 additions and 10 deletions
11
modeTheme.js
11
modeTheme.js
|
@ -1,14 +1,5 @@
|
|||
// license: https://www.w3schools.com/howto/howto_js_toggle_dark_mode.asp
|
||||
function darkTheme() {
|
||||
function darkModetheme() {
|
||||
var element = document.body;
|
||||
element.classList.toggle("dark-mode");
|
||||
var button = document.querySelector("button")
|
||||
button.classList.add("dark-modeBtn")
|
||||
}
|
||||
|
||||
function lightTheme() {
|
||||
var body = document.querySelector("body")
|
||||
body.classList.remove("dark-mode")
|
||||
var button = document.querySelector("button")
|
||||
button.classList.remove("dark-modeBtn")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue