clear method
Removes all key/value pairs from the Web Storage area.
![]() |
Syntax
var retval = Storage.clear();Parameters
This method has no parameters.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Standards information
There are no standards that apply here.
Remarks
Session storage is cleared immediately. Local storage key/value pairs are removed from memory, and disk storage quota is updated.
Examples
The following button clears the local storage area for the current domain.
<button onclick="localStorage.clear()">
Clear Stored Values</button>
See also
Show:
