Storage removeItem() method
- Vorherige Seite setItem()
- Nächste Seite clear()
- Nach oben Storage-Objekt
Definition and usage
The removeItem() method removes the specified item from the Storage object.
The removeItem() method belongs to the Storage object, which can be localStorage object, which can also be sessionStorage object.
Browser support
Method | Chrome | IE | Firefox | Safari | Opera |
---|---|---|---|---|---|
removeItem() | 4 | 8 | 3.5 | 4 | 10.5 |
Syntax
localStorage.removeItem(keyname)
Or:
sessionStorage.removeItem(keyname)
Parameter value
Parameter | Description |
---|---|
keyname | Required. A string value, specifying the name of the item to be deleted. |
Technical details
DOM version: | Web Storage API |
---|---|
Return value: | No return value |
More examples
Example
The same example, but using session storage instead of local storage.
Delete the specified session storage item:
sessionStorage.removeItem("test1");
Relevant page
Web Storage-Referenzhandbuch:getItem()-Methode
Web Storage-Referenzhandbuch:setItem()-Methode
- Vorherige Seite setItem()
- Nächste Seite clear()
- Nach oben Storage-Objekt