title: Replace image with different image/button - javascript
body: <p>within a function, I'm trying to replace a image/button with another image/button.</p>
  
  <pre><code>       &lt;img src="images/14.gif" id="ImageButton1" onClick="showLoad()"&gt;    
          &lt;img src="images/getld.png" id="ImageButton2" alt="Get Last Digits" style="display:none;" onClick="showLock()" /&gt;
  
              &lt;script type="text/javascript" language="javascript"&gt; 
  
              function swapButton(){
                      document.getElementById('ImageButton1').src = document.getElementById('ImageButton2').src;
                  }
  &lt;/script&gt;
  </code></pre>
  
  <p>But I have the problem that there is two of the same button, (button 2) when it is replaced! (one at the top of the page, and one where it is meant to be). I was wondering if there is a way of getting rid of the extra button at the top, or creating the button element within the javascript function?</p>
  
  <p>Thanks for any help.</p>