+ 2
I have a problem with Local Storage for To Do List - Can any one help me ?
Hi, i searched about my problem but i didn't found an answer for it. I have learned how to create a to do list but i want to use local storage, i tried to do it when i use loacalStorage.setItem('key', 'value') and get the value with ~~.getItem('key') for example. Can any one help me please to solve it ? this is the code sorry i'm asking from web version sololearn https://code.sololearn.com/WW7XjfbRKZ7q/#html
6 Respostas
+ 4
Abdelrahman Ashref
You can find it here
https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
Basically only 4 functions
The syntax for setting the localStorage item is as
localStorage.setItem('myCat', 'Tom');
The syntax for reading the localStorage item is as follows:
var 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();
+ 9
Not sure if this will help but if you would like to look at an example you could check out my Recipe Box which uses local storage. See https://code.sololearn.com/W930yAQ9H12Q/#html.
+ 4
localstorage cannot run on Code Playground
+ 1
Richard Myatt , I seen it but i'm not working with Vue.js i'm working with Jquery and Angular JS however this is exactly what i'm looking for.
+ 1
Calviղ , Thanks a lot sir. I will practice it now.
0
Calviղ , I got it. Do you have any link that explain local storage because i have visited W3C and nothing their.