I am not understanding how to set and get more the one item per line, like name and score... I only get back the name and last score saved... I need doing it not using JSON :/
var i=0;
function saveData()
{
var score = (Math.random()*10).toFixed();
console.log(score);
var player1 = "player1" + i;
var score = "score " + i;
i++;
player1 = prompt("What is your player1?");
localStorage.setItem(player1, score);
}
function showData()
{
var show = '';
for(var j=0 ; j<=localStorage.length-1; j++){
key = localStorage.key(j);
value = localStorage.getItem(key);
show = show+ "\n"+key;
}
alert(show + "\n"+ value);
}