title: localStorage keeps adding '0'. (jScript & HTML5)
body: <p>Well, my code have been working fine and I'm simply trying to make a simple game, until I added this (due to that I wanted to learn how to save the info to the users local storage):</p>
  
  <pre><code>if(localStorage.getItem('money'))
  {
      var Money = localStorage.getItem('money');
      document.getElementById('test').innerHTML="EXISTS";
  } else {
      localStorage.setItem('money', 0);
      var Money = localStorage.getItem('money');
      document.getElementById('test').innerHTML="DOES NOT EXIST";
  }
  </code></pre>
  
  <p>My full code looks like this:</p>
  
  <pre><code>&lt;head&gt;&lt;meta charset="UTF-8"&gt;&lt;/head&gt;
  &lt;body&gt;&lt;span id='test'&gt;&lt;/span&gt;
  Generated something: &lt;span id='money'&gt;0$&lt;/span&gt; (money per click: &lt;span id='MPC'&gt;1$&lt;/span&gt;)
  &lt;br /&gt;
  Upgrade 1 upgrades: &lt;span id='u1Us'&gt;0&lt;/span&gt; (production rate: &lt;span id='u1Pr'&gt;0&lt;/span&gt;)
  &lt;br /&gt;
  &lt;span id='updates'&gt;&lt;/span&gt;
  &lt;br /&gt;
  &lt;button onClick='mButton()'&gt;Generate something.&lt;/button&gt;
  &lt;br /&gt;&lt;br /&gt;
  &lt;b&gt;Upgrades:&lt;/b&gt;
  
  &lt;br /&gt;&lt;br /&gt;Generator upgrades:&lt;br /&gt;
  &lt;button onClick='buyU1()'&gt;Buy upgrade 1. ($30)&lt;/button&gt;
  &lt;br /&gt;&lt;br /&gt;Self-generated upgrades:&lt;br /&gt;
  &lt;button onClick='buySG1()'&gt;Buy Self-Generated Upgrade 1 ($500)&lt;/button&gt;
  &lt;/body&gt;
  &lt;script&gt;
  if(localStorage.getItem('money'))
  {
      var Money = localStorage.getItem('money');
      document.getElementById('test').innerHTML="EXISTS";
  } else {
      localStorage.setItem('money', 0);
      var Money = localStorage.getItem('money');
      document.getElementById('test').innerHTML="DOES NOT EXIST";
  }
  
  var U1Amount = 0;
  var cMoney = 1;
  
  function mButton()
  {
      Money += cMoney;
      document.getElementById('money').innerHTML=Money + "$";
  }
  function buyU1()
  {
      if(Money &lt; 30)
          {
              document.getElementById('updates').innerHTML="You do not have enough money.";
              resetUpdates();
          } else {
              Money -= 30;
              U1Amount += 1;
              document.getElementById('u1Us').innerHTML=U1Amount;
              document.getElementById('money').innerHTML=Money + "$";
              document.getElementById('updates').innerHTML="You have successfully bought Upgrade 1";
              var calcU1Amount = U1Amount * 5;
              document.getElementById('u1Pr').innerHTML=calcU1Amount;
              resetUpdates();
          }
  }
  var interval = setInterval(gMoneyU1, 1000);
  function gMoneyU1()
  {
      var calc = 5 * U1Amount;
      Money += calc;
      document.getElementById('money').innerHTML=Money + "$";
  }
  function buySG1()
  {
      if(Money &lt; 500)
          {
              document.getElementById('updates').innerHTML="You do not have enough money.";
              resetUpdates();
          } else {
              Money -= 500;
              cMoney += 1;
              document.getElementById('MPC').innerHTML=cMoney + "$";
              document.getElementById('money').innerHTML=Money;
          }
  }
  function resetUpdates()
  {
      setTimeout(function(){document.getElementById('updates').innerHTML="";}, 10000);
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I'm going to add the localStorage to all info that I want to save, but I'm having problems with the first one so yer.
  What my code WITH my save-the-persons-info outputs is: <a href="http://puu.sh/6iONl.png" rel="nofollow">http://puu.sh/6iONl.png</a> (and it keeps on in all eternally)</p>
  
  <p>It keeps adding '0' for some reason and I can't figure out why. I'd really appreciate help.
  Thanks in advance.</p>
  
  <p>Sorry if my code is messy, I'm still learning, hence why asking for help.</p>