Making a checkbox persistent on page reload?
I've created a clock based on a fantasy timezone. I've then created an "alarm" which will execute an alert if a checkbox is ticked.
I'm trying to use local storage to make the checkbox persistent on page reload, so that people can go to other pages on the website, or refresh without having to tick the box each time.
I can't seem to get it to work though and I've been through lots of similar questions, such as this one: how to Keep checkbox checked after refresh the page
Here is a codepen of the code I have: http://codepen.io/anon/pen/xqRWJM?editors=1111
Here's the html code for the checkbox:
<div id="alert">Alert me when it's night time: <input id="alertme" type="checkbox"></input> </div>