Create script.js

This commit is contained in:
ChenKaiLiuG
2025-04-25 20:57:52 +08:00
committed by GitHub
parent a7a3a8b13e
commit 3cf7551d8b

6
js/script.js Normal file
View File

@@ -0,0 +1,6 @@
const toggleButton = document.getElementById('toggle-theme');
const body = document.body;
toggleButton.addEventListener('click', () => {
body.classList.toggle('dark-mode');
});