title: "Score" variable not changing
body: <p>I'm making an online game (a very simple one, it's my first) in JavaScript and HTML. It works fine, but there is a big problem. I want that whenever a particular image is clicked, 10 is added to the value of the variable score. Here is the code I used:<br /></p>
  
  <pre><code>var score = 0;
  function addScore() {
  var test = parseInt(score);
  var score = parseInt(test) + 10;
  document.getElementById("score").innerHTML=score; }
  </code></pre>
  
  <p>And the images I want to have the functionality:</p>
  
  <pre><code>&lt;img src='mole.png' alt='mole' onclick='addScore()' /&gt;
  </code></pre>
  
  <p>What's the problem and how do I fix it?</p>