Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js save local storage

//Set item
localStorage.setItem('myCat', 'Tom');
//Get item
var cat = localStorage.getItem("myCat");
//Remove item
localStorage.removeItem("lastname");
//Remove all items
localStorage.clear();
Comment

how to save and use item from local storage javascript

window.localStorage.setItem('name', 'Obaseki Nosa');
Comment

how to save and use item from local storage javascript

const person = {
    name: "Obaseki Nosa",
    location: "Lagos",
}

window.localStorage.setItem('user', JSON.stringify(person));
Comment

how to save and use item from local storage javascript

window.localStorage.getItem('user');
Comment

PREVIOUS NEXT
Code Example
Javascript :: excel date to javascript date 
Javascript :: jquery check if element has css display none 
Javascript :: urlencode javascript 
Javascript :: react native navigation transparent header 
Javascript :: npx react 
Javascript :: get last path segment of url in javascript 
Javascript :: onclick javascript confirm 
Javascript :: trigger change 
Javascript :: addclass js vanilla 
Javascript :: start react 
Javascript :: parse document.cookie 
Javascript :: js post 
Javascript :: c3 json from string 
Javascript :: java.lang.outofmemoryerror (no error message) react native 
Javascript :: Appium click on element Javascript 
Javascript :: JS get random number between 
Javascript :: node.js gitignore 
Javascript :: javascript get scroll position 
Javascript :: javascript repeat each second 
Javascript :: javascript get current time 
Javascript :: javascript int max 
Javascript :: how to change background image url in javascript 
Javascript :: js remove trailing slash 
Javascript :: update react app 
Javascript :: react bootstrap styles not working 
Javascript :: react js usehistory push and pass props 
Javascript :: stop immediate propagation 
Javascript :: js fetch delete 
Javascript :: javascript scroll to end of div 
Javascript :: check if parameter is array javascript 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =