diff --git a/index.html b/index.html
index 18cdc46..1e924ce 100644
--- a/index.html
+++ b/index.html
@@ -40,8 +40,8 @@
Emoji Glossary
@@ -49,8 +49,8 @@
diff --git a/script.js b/script.js
index 3881652..a7c430f 100644
--- a/script.js
+++ b/script.js
@@ -40,11 +40,15 @@ document.addEventListener('DOMContentLoaded', () => {
const applyTheme = (isDark) => {
document.documentElement.classList.toggle('dark', isDark);
// Mobile icons
- lightIcon.classList.toggle('hidden', !isDark);
- darkIcon.classList.toggle('hidden', isDark);
+ if (lightIcon && darkIcon) {
+ lightIcon.classList.toggle('hidden', !isDark);
+ darkIcon.classList.toggle('hidden', isDark);
+ }
// Desktop icons
- lightIconDesktop.classList.toggle('hidden', !isDark);
- darkIconDesktop.classList.toggle('hidden', isDark);
+ if (lightIconDesktop && darkIconDesktop) {
+ lightIconDesktop.classList.toggle('hidden', !isDark);
+ darkIconDesktop.classList.toggle('hidden', isDark);
+ }
};
const toggleDarkMode = () => {