存数据
var obj = {"name":"ergouzi","age":"16"}
localStorage.setItem("userInfo",JSON.stringify(obj));
取数据
var user = JSON.parse(localStorage.getItem("userInfo"))
删除数据
localStorage.removeItem("userInfo);
var obj = {"name":"ergouzi","age":"16"}
localStorage.setItem("userInfo",JSON.stringify(obj));
var user = JSON.parse(localStorage.getItem("userInfo"))
localStorage.removeItem("userInfo);