Change the status of the CheckBox on restart based on LocalStorage
Hello!
There is a task to make sure that the progress between sessions is saved in localStorage. Specifically, the CheckBox states (Normal/Selected).
1. Using JavaScript, I made it so that when clicking on the CheckBox, information about its status was added to localStorage (true) and to the global variable Storyline (true).
2. When restarting the browser and opening the slide in a new session, JavaScript checks for localStorage, and if there is = true, then the global variable Storyline also sets = true.
3. Next, a trigger is created to change the state to "Selected" if the global variable Storyline = true, but this does not happen.
Please tell me, what could be the matter? As I understand it, it is not provided to change the states when running through pure JavaScript.
P.S. In the example, only the first (red) CheckBox is added
Thanks.