title: How to save to localStorage from textarea?
body: <p>I am trying to save an email entered to textarea in <code>localStorage</code>. I see the placeholder "your gmail address" when I load the page, but when I enter a value and click "save" nothing happens. I don't see the alert or the console verifying that text is saved. What am I doing wrong?</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;title&gt;Extension Options&lt;/title&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;textarea id="user" style="margin-bottom: 4px; width: 250px; height: 20px"&gt;
  &lt;/textarea&gt;&lt;br /&gt;
  &lt;button id="save"&gt;Save&lt;/button&gt;
  &lt;!--&lt;button id="save"&gt;Clear&lt;/button&gt;--&gt;
  
  &lt;script type="text/javascript"&gt;
  
  //check if "user" is in localStorage
  
  if (localStorage["user"])
  {
      var user = localStorage["user"] ;
      document.getElementById("user").value = user ;
      alert("you are already a user")
  }
  else
  {
      document.getElementById("user").placeholder = "your gmail address" ;
      console.log("user no found in localStorage")
  }
  
  //save entered gmail address
  document.getElementById("save").addEventListener
  {
      "click", function ()
      {
          var user = document.getElementById("user").value ;
          //localStorage["user"] = user ;
          localStorage.setItem("user", user) ;
          alert("gmail id saved") ;
          console.log("gmail id saved")
      } , false
  }
  
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>