localStorage.aa="aa"; //存储了一个key为aa并且value为aa的键值对; localStorage.setItem("bb", "bb");//存储了一个key为bb并且value为b的键值对; localStorage.getItem("bb");//获取一个key为bb的value; localStorage.clear(); //将localStorage存储的所有键值对清除; localStorage.removeItem("aa"); //将aa为Key的值删除; localStorage.length; //返回所有的键值对的个数; localStorage.key(n); //返回第n个键值对的键;