Leetcode icon indicating copy to clipboard operation
Leetcode copied to clipboard

43. 您如何访问网络存储

Open webVueBlog opened this issue 3 years ago • 0 comments

Window 对象分别实现具有(window.localStorage) 和(window.sessionStorage) 属性的WindowLocalStorage和对象。这些属性创建一个 Storage 对象的实例,通过它可以为特定域和存储类型(会话或本地)设置、检索和删除数据项。例如,您可以对本地存储对象进行读写,如下所示WindowSessionStoragelocalStoragesessionStorage

localStorage.setItem("logo", document.getElementById("logo").value);
localStorage.getItem("logo");

webVueBlog avatar Jun 09 '22 02:06 webVueBlog