//存储本地存储----setItem(存储名称,数据名称)
var c={name:"man",sex:"woman"};
localStorage.setItem("firstws","123");
localStorage.setItem("firstws",JSON.stringify(c));//为了读取后使用,存储格式转为字符串
//读取本地存储----getItem(存储名称)
var dd=localStorage.getItem("firstws");//object
dd=JSON.parse(dd);//json格式
//删除本地存储----removeItem(存储名称)
localStorage.removeItem("firstws");