localStorage.setItem("user",JSON.stringify({name:'我爱模板网',age:18})); console.log(localStorage.getItem("user")); alert(JSON.parse(localStorage.getItem("user")).name); alert(JSON.parse(localStorage.getItem("user")).age);
部分素材资源来源网站,本站提供免费下载,如有侵权请联系站长马上删除!