Represents the list of key/value pairs that have been assigned to a single storage area.
The HTMLStorage object has these types of members:
The HTMLStorage object has these methods.
Removes all key/value pairs from the Web Storage area.
Retrieves the current value associated with the Web Storage key.
Retrieves the key at the specified index in the collection.
Deletes a key/value pair from the Web Storage collection.
Sets a key/value pair.
The HTMLStorage object has these properties.
Returns a reference to the constructor of an object.
Retrieves the length of the key/value list.
Retrieves the remaining number of UTF-16 characters allowed for the storage object.
Each Storage object provides access to a list of key/value pairs, which are sometimes called items. Keys are strings, and any string (including the empty string) is a valid key. Items contain values (which are also strings) and associated metadata.
Each Storage object is associated with a list of key/value pairs when it is created. Multiple Storage objects, such as two instances of localStorage, can be associated with the same list of key/value pairs simultaneously.
Key names are exposed as properties on this object. For example, the following statements are equivalent:
sessionStorage.setItem('myKey', '...'); sessionStorage['myKey'] = '...'; sessionStorage.myKey = '...';