I wanted to ask why innerHTML is not working in the following code:
document.getElementById('text').innerHTML = localStorage["mytext"];
The element with the id text is a div element. localStorage is giving me the right String if I use it with alert, what could the error be?
Make sure the div exists before trying to reference it,
That will wait for the document to load before doing any modifications