Web Storage

๐ŸŒ HTML5 ๐ŸŸข Chapter 28 of 37 ๐Ÿ“‚ Phase 11: HTML APIs & Features ๐Ÿ“… 2026 Edition
๐Ÿ“Œ Covered in this chapter: Local Storage vs Session Storage ยท Storage Quotas & Limits ยท setItem(), getItem(), removeItem(), clear() ยท JSON Serialization ยท Storage Events ยท XSS Security Rules
Welcome to Phase 11 (Chapter 28): Web Storage! Store key-value data persistently in the browser using localStorage and sessionStorage.
1localStorage & JSON Serialization Syntax
JavaScript โ€” localStorage & JSON โ–ถ Run in HTML Editor
<script>
  const user = { name: "Balaji", theme: "dark" };
  localStorage.setItem('user_profile', JSON.stringify(user));
  const saved = JSON.parse(localStorage.getItem('user_profile'));
  console.log('Stored Name:', saved.name);
</script>
OC
Written by Our Compiler Technical Editorial Team
Reviewed for accuracy & tested on HTML5 Standards ยท Last updated August 2026