title: onclick event not working
body: <p>Trying to make a image based button that will change a image on the page</p>
  
  <p>Here is the code I have</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  function nextimg()
  {
  alert("clicked")
  document.getElementById("image").src="images/gallery/gallery-2.jpg";
  }
  
  &lt;/script&gt;
  &lt;div class="gallery"&gt;
  &lt;table&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;img src="images/lt_arrow_dark.png"/&gt;&lt;/td&gt;
  &lt;td&gt;&lt;img id="image" src="images/gallery/gallery-1.jpg"/&gt;&lt;/td&gt;
  &lt;td&gt;&lt;img onclick="nextimg()" src="images/rt_arrow_dark.png" height="55" width="24"/&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Nothing happens when I click on the image. Any Ideas? Thanks</p>