Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- First you need to add at body tag this code:
- <body id="switch">
- than this pure javascript code:
- function myFunction(){var element=document.getElementById("switch");element.classList.toggle("night");}
- than add the switch to toggle between night and day mode with our function:
- <input onclick="myFunction()" type="checkbox" id="switch2" />
- <label class="switchy" for="switch2" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement