local storage api js code example
Example 1: local storage
function setItem(name, value) {
localStorage.setItem(name, value);
}
function getItem(name) {
localStorage.getItem(name);
}
function deletItem(name) {
localStorage.removeItem(name);
}
function clearStorage() {
localStorage.clear();
}
Example 2: my local storage
/* function for setIetm to local storage */
function set(){
var sendJson = JSON.stringify(allwish);
localStorage.setItem("wishKay",sendJson);
}