I am trying to swap the source of the image in the image tag when the onclick event of the A HREF fires off. I know I should have this as a separate function as opposed to trying to do it inline, but that isn't a possibility for what I am doing. If I take out the image swap if, it fires correctly, but with it in, it isn't firing.
Here is the source:
Any ideas are greatly appreciated. :)
Here is the source:
Code:
<table border=1 bordercolor="dddddd" cellspacing=0 cellpadding=1>
<tr bgcolor="AAAAFF">
<td style="width: 25px"><a href=""
onclick="
if (document.getElementById(\'offerHistory\').style.display == \'none\')
{document.getElementById(\'offerHistory\').style.display = \'inline\';}
else {document.getElementById(\'offerHistory\').style.display = \'none\';};
if (document.getElementById(\'offerHistory\').style.display == \'none\')
{ document.getElementById(\'offerHistImage\').SetAttribute("src", "./images/arrow-right-2.png";}
else{ document.getElementById(\'offerHistImage\').SetAttribute("src", "./images/arrow-right-2.png";};
return false;">
<img id="offerHistImage" src="./images/arrow-down-2.png" />
</a>
</td>
<td>Offer History</td>
</tr>
<tr><td colspan="2">
<div id="offerHistory" style="display: none;">
<table border=1 bordercolor="dddddd" cellspacing=0 cellpadding=1>
Comment