I have found this article helpful: HTML5 localStorage: check if item is set
But, I can't find a solution, to the following issue.
A want to use 8 localStorage variables: names0, names1, names2 ... etc... names7
Then when a page loads, check to see they have been used, then show up to 8 -divs- accessed through the variable if so .
var cs = document.getElementsByClassName("classSelect");
for (i = 0; i < 8; i++) {
if (localStorage.getItem("names" + i) !== null) {
alert("worked " + i);
cs[i].style.display = "block";
}
I'm note sure how to achieve this.