title: LocalStorage on HTML 4 website in modern browsers?
body: <p>I was thinking about writing a JS wrapper to have an HTML 5 <code>localStorage</code> object on older websites using HTML 4, because everybody says its only available with HTML 5. So I wrote up <a href="http://jsfiddle.net/HB7Vh/" rel="nofollow">this simple page</a>:</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;&lt;/title&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;script type="text/javascript"&gt;
              console.log(localStorage);
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>... and I expected the console to give me an <code>undefined</code> so I can start implementing. But it just shows the local storage object, which I can use normally! I tried it on latest version of Chrome, Safari and Firefox, and it just works.</p>
  
  <p>So my Q is:</p>
  
  <p><strong>Do I miss something or is <code>localStorage</code> usable in modern browsers regardless of the doctype stating HTML4 or HTML5?</strong> </p>
  
  <p>Is it just not known that this works? Works for me... but why is everybody talking about HTML 5 being a requirement then? I did not find any source stating this just works in HTML4.</p>