Multiple storages using localStorage
Posted
by Blondie
on Stack Overflow
See other posts from Stack Overflow
or by Blondie
Published on 2010-05-14T22:16:14Z
Indexed on
2010/05/14
22:44 UTC
Read the original article
Hit count: 239
Hey,
Is it possible that the same name used can have many different values stored separately and to be shown in a list?
e.g.
function save()
{
var inputfield = document.getElementById('field').innerHTML;
localStorage['justified'] = inputfield;
}
<input type="text" id="field" onclick="save();" />
Everytime someone enters something in the input field, and click on save, the localstorage will only save the value in the same name, however, does this conflict the way storage are saved, like being replaced with the latest input value?
Also, is there anyway to prevent clearing the localstorage when clearing the cache?
Thanks.
© Stack Overflow or respective owner