First like to say I upload those as I work on it at http://ali-hassan.info I have a table, when I click an item in the table it updates in an array for that cell, so when the page loads the cells variable is 0, when clicked it changes to 1, when that occurs I'd like for the image to change for that one cell, at the moment I have it as this in my javascript, there is a function that actually changes the cell's variable to 1.
function changeImage()
{
element=document.getElementById('myimage')
if (element.src.match("empty"))
{
element.src="1.gif";
}
else
{
element.src="2.gif";
}
}
And this is a sample of the HTML table
<td><div align="center">A</div></td>
<td class='n' id='a1' onclick="myFunction(1,0)"><img id="myimage" onclick="changeImage(1)" src="empty.gif"/></td>
<td class='n' id='a2' onclick="myFunction(2,0)"><img id="myimage" onclick="changeImage(2)" src="empty.gif"/></td>
<td class='n' id='a3' onclick="myFunction(3,0)"><img id="myimage" onclick="changeImage(3)" src="empty.gif"/></td>
<td class='n' id='a4' onclick="myFunction(4,0)"><img id="myimage" onclick="changeImage(4)" src="empty.gif"/></td>
<td></td>