Code to retain Website's "Dark Mode" after refreshing | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Code to retain Website's "Dark Mode" after refreshing

I have a dark mode button on my website made using jQuery. When I refresh my website it losses its configuration and changes back to light mode automatically. Is there any code/script or something like cookies to fix it.

1st Jun 2020, 6:43 AM
Mukesh Kaswan
Mukesh Kaswan - avatar
1 Respuesta
0
Use a cookie; lookup "document.cookie"
1st Jun 2020, 6:50 AM
JME