Storage Web Storage
Last updated: 2026-09-09
Storage Web Storage
Storage represents the Web Storage API.
| Category | Browser (BOM) |
|---|---|
| ES version | ES1 |
📝 Syntax
localStorage.setItem('key', 'value');
▶ Example
Edit the code, press Run, and see the result in the output panel:
Output:
dark
Zhang
💡 Tip localStorage for user preferences, not sensitive data.
⚠️ Warning User can modify via DevTools — never store sensitive info.
🏷️ Related Items
💡 Related Cases
More case studies coming soon — check back later.
📚 Related Tutorials
❓ FAQ
QlocalStorage vs sessionStorage?
AlocalStorage persists; sessionStorage clears on tab close.
QCapacity limit?
A~5MB.
QIs it secure?
ANo — never store passwords.