Source Code:
(back to article)
Submit
Result:
Report an issue
<style> .dark-mode { background-color: black; color: white; } </style> <button id="toggleButton">Toggle Dark Mode</button> <script> document.getElementById("toggleButton").addEventListener("click", function() { document.body.classList.toggle("dark-mode"); }); </script>