title: Change image onclick with div toggle
body: <p>I have some code I'm working on that toggles a div of information depending on the user clicking an image. What I'm looking for is assistance in getting the image to swap when the user clicks, then to swap back when it's clicked again. The image should be changing to: <a href="https://casetest.blackboard.com/bbcswebdav/users/kas200/collapse.gif" rel="nofollow">https://casetest.blackboard.com/bbcswebdav/users/kas200/collapse.gif</a></p>
  
  <p>I'm a newbie when it comes to coding with JS, so any help provided would be much appreciated! </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function toggleMe(a){
          var e=document.getElementById(a);
          if(!e)return true;
          if(e.style.display=="none"){
              e.style.display="block";
          }
          else{
              e.style.display="none";
          }
          return true;
      }
  &lt;/script&gt;
  
  &lt;input type="image" src="https://casetest.blackboard.com/bbcswebdav/users/kas200/expand.gif" onclick="return toggleMe('para1')" value="Toggle"&gt;&lt;br&gt;
  &lt;div id="para1" style="display:none"&gt;
      This is my text for section 1!
  &lt;/div&gt;
  &lt;br&gt;
  &lt;input type="image" src="https://casetest.blackboard.com/bbcswebdav/users/kas200/expand.gif" onclick="return toggleMe('para2')" value="Toggle"&gt;&lt;br&gt;
  &lt;div id="para2" style="display:none"&gt;
      This is my text for section 2!
  &lt;/div&gt;
  &lt;br&gt;
  &lt;input type="image" src="https://casetest.blackboard.com/bbcswebdav/users/kas200/expand.gif" onclick="return toggleMe('para3')" value="Toggle"&gt;&lt;br&gt;
  &lt;span id="para3" style="display:none"&gt;
      This is my text for section 3!
  &lt;/span&gt;
  </code></pre>