Answers for "get item in localstorage javascript"

0

localstorage.getitem()

//The following snippet accesses the current domain's local Storage object 
//and adds a data item to it using Storage.setItem().
localStorage.setItem('myCat', 'Tom');

//The syntax for reading the localStorage item is as follows:
const cat = localStorage.getItem('myCat');

//The syntax for removing the localStorage item is as follows:
localStorage.removeItem('myCat');

//The syntax for removing all the localStorage items is as follows:
localStorage.clear();
Posted by: Guest on September-05-2020
-1

get localstorage value

localStorage.getItem('bgcolor');
Posted by: Guest on March-10-2020

Code answers related to "get item in localstorage javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language