Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.
Set data as follow:-
localStorage.setItem("Key", value);
and to get Item from local storage
localStorage.getItem("key");
Also check if browser supports local storage before using it. It will look something like this:-
if(Storage == undefined || typeOf(Storage) == "undefined")
{
alert("Storage is not supported")
}
else
{
// Get or Set Item
}