Advertisement
  1. Code
  2. JavaScript
  3. Web APIs

Quick Tip: Learning About HTML5 Local Storage

Scroll to top
Read Time: 1 min
This post is part of a series called HTML5 and You.
HTML5 Audio and Video: What You Must Know
The Official Guide to HTML5 Boilerplate

In today's video quick tip, we're going to build a working, though very basic, to-do list in just a minute or two. Thanks to HTML5's local storage, we can make advanced browsers "remember" what we type, even after the browser is closed or is refreshed.

"localStorage sets fields on the domain. Even when you close the browser, reopen it, and go back to the site, it remembers all fields in localStorage."
-QuirksBlog

While obviously not supported across all browsers, we can expect this method to work, most notably, in Internet Explorer 8, Safari 4, and Firefox 3.5. Note that, to compensate for older browsers that won't recognize local storage, you should first test to determine whether window.localStorage exists.

Support matrix

via http://www.findmebyip.com/litmus/
Advertisement
Did you find this post useful?
Want a weekly email summary?
Subscribe below and we’ll send you a weekly email summary of all new Code tutorials. Never miss out on learning about the next big thing.
Advertisement
Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.