I currently have an image that changes when you click it but when I click on another image I would like it to return back to its default image state.
the code I have so far is below.
$('a img.lrg').click(function(){
var newSrc = $(this).attr("src").replace("largefont.gif", "largefonton.gif");
$(this).attr("src", newSrc);
});
How can I change this to do the desired effect?
Thanks,
Sat
Use
data()to hold the old srcFiddle: http://jsfiddle.net/maniator/94CqN/