title: Functions sets innerHTML to null
body: <p>I want the image to change when I click on it </p>
  
  <p>I tried to build a function that gets the ID of the item I clicked and on tries to replace the image with its ID.</p>
  
  <p><code>onclick='M(this);</code></p>
  
  <pre><code>function M(currentThis) {
      if (redTurn == false) {
          document.getElementById(currentThis).innerHTML = "&lt;img src=" + images[1] + " style='width:60px; height:60px' /&gt;";
      }
  }
  
  </code></pre>
  
  <p>The innerHtmL sets to null but it should get the ID of the item.</p>