Stelian Posted November 6, 2019 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 Link to comment Share on other sites More sharing options...
dsonesuk Posted November 7, 2019 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 Link to comment Share on other sites More sharing options...
Stelian Posted November 8, 2019 Author 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now