HTML5 provides a new way to store data on the client side and is supported by other browsers except IE7 and the following are not supported.
Brief description: Localstorage-no time limit data storage, as long as the user does not manually purge will remain in the local, sessionstorage-session session of the data storage, turn off the browser is cleared; Localstorage and Sessionstorage all have the following methods:
1. Storing DataLocalstorage.setitem ("Key", "value");//key is the stored data name, similar to the name in the Var name= "Shire". or localstorage.key= "value";//an Object-like action method
2. Delete a single specified dataLocalstorage.removeitem ("key");
3. Delete all dataLocalstorage.clear (); If you want to change a stored data, use the SetItem to overwrite the data that you want to change.
4. Get locally stored data-checkvar value=localstorage.getitem ("key");//value is the value that is saved
5.key () and length implementation traversal of stored dataRefer to the following demo for specific use:
<! DOCTYPE html>