Answers for "how to set item in local storange"

0

javascript storage get set item

// *** JS Storage Get/Set item *** 

	let target = document.getElementById("target");
    let increment = document.getElementById("increment");
    let count = localStorage.getItem("counter") || 0;
    target.innerHTML = count;

    increment.addEventListener("click", () => {
        count++;
        localStorage.setItem("counter", count);
        target.innerHTML = count;
    })
Posted by: Guest on October-27-2020
2

set localstorage value

localStorage.setItem("mytime", Date.now());
Posted by: Guest on March-10-2020

Code answers related to "how to set item in local storange"

Code answers related to "Javascript"

Browse Popular Code Answers by Language