HTML Web Storage API

Article Summary

Learn how the HTML Web Storage API stores data using localStorage and sessionStorage.

The Web Storage API stores data inside the browser.


Types of Storage

  • localStorage → permanent
  • sessionStorage → temporary

Example

<script>
localStorage.setItem("user", "John");
</script>
Was this helpful?