A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/en-US/docs/Web/API/Storage/clear below:

Storage: clear() method - Web APIs

Storage: clear() method

Baseline Widely available

The clear() method of the Storage interface clears all keys stored in a given Storage object.

Syntax Parameters

None.

Return value

None (undefined).

Examples

The following function creates three data entries in local storage, and then deletes them by using clear().

function populateStorage() {
  localStorage.setItem("bgcolor", "red");
  localStorage.setItem("font", "Helvetica");
  localStorage.setItem("image", "miGato.png");

  localStorage.clear();
}

Note: For a real-world example, see our Web Storage Demo.

Specifications Browser compatibility See also

Using the Web Storage API


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4