Stelian 0 Posted November 6, 2019 Report Share Posted November 6, 2019 Hello, I made some buttons with functions to change text size and style also another button to change site theme, but I can not make them save after I go to the next page or after I reload the page. I want to use local storage but I don't know if it is possible. Here is my project: https://github.com/Stelian1996/projects-folder Quote Link to post Share on other sites
dsonesuk 929 Posted November 7, 2019 Report Share Posted November 7, 2019 Localstorage will do that. First you set a default value if localstorage does not currently store any value related to chosen font size, else load localstorage value and make the chosen font-size active on page load or refresh. Then set onclick event to make selected fontsize active then at same set localstorage to store currently selected font-size also. 1 Quote Link to post Share on other sites
Stelian 0 Posted November 8, 2019 Author Report Share Posted November 8, 2019 I accidentally made another topic of this problem and In it I show my code with local storage. It works but it does not save after reload. Link to the other topic Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.