Storage removeItem() Method | localstorage clear item
❮StorageObject[1]ExampleRemovethethespecifiedlocalstorageitem:localStorage.removeItem("mytime");TryitYourself»[2]DefinitionandUsageTheremoveItem()methodremovesthespecifiedStorageObjectitem.TheremoveItem()methodbelongstotheStorageObject,whichcanbeeitheralocalStorage[3]objectorasessionStorrage[4]object.BrowserSupportMethodremoveItem()483.5410.5SyntaxlocalStorage.removeItem(keyname)Or:sessionStorage.removeItem(keyname)ParameterValuesParameterDescriptionkeynameRequired.AStringspecifyingthenameof...
❮ Storage Object[1]
ExampleRemove the the specified local storage item:
localStorage.removeItem("mytime");
Try it Yourself »[2] Definition and UsageThe removeItem() method removes the specified Storage Object item.
The removeItem() method belongs to the Storage Object, which can be either a localStorage[3] object or a sessionStorrage[4] object.
Browser Support Method removeItem() 4 8 3.5 4 10.5 SyntaxlocalStorage.removeItem(keyname)
Or:sessionStorage.removeItem(keyname)
Parameter Values Parameter Description keyname Required. A String specifying the name of the item you want to remove Technical Details DOM Version: Web Storage API Return Value: No return value More Examples ExampleThe same example, but using session storage instead of local storage.
Remove the specified session storage item:
s...