localStorage.a1 = '1'; localStorage.a2 = '2'; localStorage.a3 = '3'; for (var i = 0; i < localStorage.length; i++) { alert(localStorage[i] + " = " + localStorage[localStorage[i]]); }