Register now or log in to join your professional community.
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
}