I’m sure this is really simple, but I’m having problems with it.
I have the following jQuery operations which don’t seem to be working:
$("img[id='Char_2']").attr("src", "http://image.xboxlive.com/global/t.584108a4/tile/0/2800e");
$("img[id='Char_" + Character + "']").attr("src", "http://image.xboxlive.com/global/t.584108a4/tile/0/2800d");
I’m testing it: http://jsfiddle.net/PottyMonster/M6ZqD/
What is the solution?
The problem is not where you think it is. It’s not in the ID, but rather, your
onClickwas never called.Here’s a working example, written unobtrusively: