title: Javascript multiple image change with button clicks
body: <p>Ok, this is what I'm trying to do, it was too vague earlier so here's a better explanation, keep in mind I've only been programming pages for like 2 weeks now so any help is appreciated.</p>
  
  <p>I need to create a HTML/JavaScript webpage that displays three images along with a caption (description) for each image.  For each image I need to also create a button that changes the first image to a different image on the same subject (and change the caption too). Also need to have a button that restores all three images back to the original images.</p>
  
  <p>I got the coding to work so that one image would change to another on button click but then when I added my 2nd and 3rd coding nothing would work anymore.</p>
  
  <pre><code>&lt;html&gt; 
  &lt;head&gt; 
  &lt;script&gt; 
  
  function changeImage()
  {
  var img = document.getElementById("image");
  img.src="http://cdn.memegenerator.net/images/300x/159304.jpg";
  return false;
  }
  
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;img id="image" src="http://thechive.files.wordpress.com/2011/10/william-defoe.jpg" /&gt;
  &lt;br&gt;&lt;br&gt;&lt;br&gt;
  &lt;button id="clickme" onclick="changeImage();"&gt;Click to change image!&lt;/button&gt;
  
  &lt;script&gt; 
  
  function changeImage()
  {
  var img = document.getElementById("image1");
  img.src="http://playerperspective.com/wp-content/uploads/2011/05/mike-tyson-3.jpg";
  return false;
  }
  
  &lt;/script&gt;
  
  &lt;body&gt;
  &lt;img id="image1" src="http://static.guim.co.uk/sys-    images/Sport/Pix/pictures/2008/10/31/1225454147507/Mike-Tyson-001.jpg" /&gt;
  &lt;button id="Click1" onclick="changeImage();"&gt;Click to change!&lt;/button&gt;
  &lt;/body&gt;
  
  &lt;br&gt;
  
  &lt;script&gt; 
  
  function changeImage()
  {
  var img = document.getElementById("image2");
  img.src="http://static.guim.co.uk/sys-images/Technology/Pix/pictures/2012/3/5/1330958259135/Halo-4-007.jpg";
  return false;
  }
  
  &lt;/script&gt;
  
  &lt;body&gt;
  &lt;img id="image2" src="http://cdn.slashgear.com/wp-content/uploads/2012/04/halo-master- chief-1.jpg" /&gt;
  &lt;button id="Click2" onclick="changeImage();"&gt;Click to change!&lt;/button&gt;
  &lt;/body&gt;
  
  &lt;br&gt;
  
  &lt;/html&gt;
  </code></pre>