I have an image inside a table cell which is also a clickable link with the following markup:
<a class="modalInput" rel="#flagsSummary" style="cursor:pointer">
<img src="/FatcaOne_0/static/images/circleRed.png" width="20" height="20">
</a>
I am confused about the syntax of Javascript that I need to use just to change the source of the image or the image itself and leave the element and its attributes untouched. I tried this but that changes the link also which I don't want:
rows[lastRowClicked].cells[0].innerHTML = '<a class="modalInput" rel="#flagsSummary" style="cursor:pointer"><img src="/FatcaOne_0/static/images/circleYellow.png" width="20" height="20"></a>';
I only wish to change the image in the last row that was clicked.