HTMLHTML5 Local Storage

localStorage lets you store data in the browser that stays even after refreshing or closing the page.

<script>
  localStorage.setItem('username', 'Sagar');
  console.log(localStorage.getItem('username')); // Output: Sagar
</script>