Answers for "clear item from localstorage"

5

javascript clear localstorage

window.localStorage.clear(); //clear all localstorage
window.localStorage.removeItem("my_item_key"); //remove one item
Posted by: Guest on July-31-2019
0

how to setItem and getItem in javascript in localStorage

function set(){
    var sendJSON = JSON.stringify(allMovie);
    localStorage.setItem('allMovie',sendJSON)
}

function get(){
    var getJSON = localStorage.getItem('allMovie');
    if (getJSON){
        allMovie = JSON.parse(getJSON)
    }

}
Posted by: Guest on August-10-2020
0

localstorage clear item

localStorage.removeItem(key);
Posted by: Guest on April-27-2020

Code answers related to "clear item from localstorage"

Code answers related to "Javascript"

Browse Popular Code Answers by Language