title: JSFiddle does Javascript correctly, but not on the browser
body: <p>I've tested a Javascript on JSFiddle for a localStorage-working textarea. Once I make the HTML page and load it up, it doesn't use the Javascript written.</p>
  
  <p>Here's my HTML code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Page Title&lt;/title&gt;
  &lt;script type='text/javascript' src='http://code.jquery.com/jquery-1.4.2.js'&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.js"&gt;&lt;/script&gt;
  &lt;script type='text/javascript'&gt;
      jQuery(function($) {
      var editor = document.querySelector("#editor");
      if (window.localStorage["TextEditorData"]) {
          editor.value = window.localStorage["TextEditorData"];
      }    
      editor.addEventListener("keyup", function() {
      window.localStorage["TextEditorData"] = editor.value;
      });
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onLoad=".ready()"&gt;
  &lt;textarea id="editor"&gt;&lt;/textarea&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>What did I miss? Testing it on JSFiddle works correctly.</p>