首页 > 解决方案 > Use localstorage to remember dark mode preference

问题描述

I'm working on a website for myself, a search engine. My intention is to make it a nice and fast search engine. Now I like the website and have added dark mode. You can turn it on and off with the green button. Now I am a total novice in javascript and I know literally nothing about it. How can I make localstorage remember whether you have turned on light or dark theme?

This is the project: https://glitch.com/edit/#!/mozobrowser?path=index.html%3A1%3A0 and this is the website: https://mozobrowser.glitch.me/

I would really appreciate if someone would help me.

标签: javascriptlocal-storagedarkmode

解决方案


推荐阅读