Can anyone help me with this code? I think there are some error but i don't know what error is it.
Code:
function storeEmail(){
var Emails = [];
if(localStorage.Emails){
Emails = JSON.parse(localStorage.Emails);
}
Emails.push(getElementById("email").value);
localStorage.setItems('Emails',JSON.stringify(Emails))
}


function email_db(){
var Emails = [];
Emails = JSON.parse(localStorage.emails);
var out = "";
var i;
for(i = 0; i < localStorage.length; i++){
out += '<tr><td>' + ++i + '</td><td>' + emails[i] + '</td></tr>';
}
document.getElementById("table").innerHTML = out;
}
I want to store the data every time i submit a new form and retrieve all the data stored to show it as a table.