title: update/add localStorage with variable
body: <p>Im trying to save the user's clicks in the localStorage and then when the user comes back and clicks the localStorage will add the new clicks.</p>
  
  <p>This is what I have:</p>
  
  <pre><code>var storedClicks = localStorage.getItem("clicks");
  
    function count_clicks()
  {
      var count = parseInt(document.cnt_click.cnt_clicks.value);
      count++;
      document.cnt_click.cnt_clicks.value = count;
      localStorage.setItem("clicks", storedClicks + count);
          if(count == 10) {
             alert(document.cnt_click.cnt_clicks.value);
          }
          $('#printHere').html(storedClicks);
  
  }
  </code></pre>
  
  <p>But all this does is just adding the number at the end, so lets say this is the user's click history:</p>
  
  <p>Visit 1: 2 clicks
  Visit 2: 6 clicks
  Visit 3: 3 clicks</p>
  
  <p>The output will then be 263 clicks, not 11 clicks. What do I need to change/do and for some reason it won't print the clicks.</p>
  
  <p>Thanks in advance!</p>