English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Storage removeItem() Method

JavaScript Storage Object

removeItem()This method deletes the specified key from the given storage object.

If there is no item associated with the given key, this method will not perform any operation.

The removeItem() method belongs to the storage object and can belocalStorageorsessionStorageObject.

Syntax:

localStorage.removeItem(keyName)
sessionStorage.removeItem(keyName)
localStorage.removeItem('url');
Test and See‹/›

Browser Compatibility

The numbers in the table specify the first browser version that fully supports the removeItem() method:

Method
removeItem()43.511.549

Parameter Value

ParameterDescription
keyNameA string containing the key name to be deleted

Technical Details

Return Value:None
DOM Version:Network Storage API

More Examples

Delete the value of the specified session storage item:

sessionStorage.removeItem('time');
Test and See‹/›

Related References

HTML Tutorial:Web Storage API

Window (Window) Reference:window.localStorage property

Window (Window) Reference:window.sessionStorage property

JavaScript Storage Object