sorry if code is a bit cumbersome I’m a very new “developer”
So, I created a form and when you hit submit 3 things happen:
1. Input values are stored in an array inside localStorage.
2. Values are retrieved and are shown up in dynamically created divs.
3. Prevent submit (form is not sent).
My problem is whenever I refresh the page after submitting new entries, the dynamically created divs disappear (while they’re still stored in localStorage).
How do I keep my submitted divs even after refresh?
You should do the same function when loading the page as on the submit.
I have an example here: https://codepen.io/jeroenreijs/pen/VrxGXO
The loading of the tasks is done in here on submit and on loading the page.
Viewing 2 posts - 1 through 2 (of 2 total)