title: Changing a large image with JavaScript when clicking a thumbnail image
body: <p>I have used the following HTML/JavaScript code to make a webpage where I can change a larger image by clicking a thumbnail image:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function ChangeImage(a) {
      document.getElementById("viewer").src = a;
      }
  &lt;/script&gt;
  
  &lt;section&gt;
      &lt;img class="thumbnail" src="/images/Thumbnails/FormalHeadshot1.JPG" onclick="ChangeImage("/images/FormalHeadshot1.JPG");"&gt;
      &lt;img class="thumbnail" src="/images/Thumbnails/FormalHeadshot2.JPG" onclick="ChangeImage("/images/FormalHeadshot2.JPG");"&gt;
      &lt;img class="thumbnail" src="/images/Thumbnails/Performing.JPG" onclick="ChangeImage("/images/Performing.JPG");"&gt;
      &lt;img class="thumbnail" src="/images/Thumbnails/Playing.JPG" onclick="ChangeImage("/images/Playing.JPG");"&gt;
      &lt;img class="thumbnail" src="/images/Thumbnails/InformalHeadshot.JPG" onclick="ChangeImage("/images/InformalHeadshot.JPG");"&gt;
  
      &lt;br&gt;
  
      &lt;img id="viewer" src="/images/FormalHeadshot1.JPG"&gt;
  
  &lt;/section&gt;
  </code></pre>
  
  <p>Any idea why when I click the thumbnail images nothing happens to the large picture? I kinda new to JavaScript, so I may be missing something obvious, but research I've done hasn't seemed to solve the problem.</p>