I\'m trying to get an image to swap on the click event of a div class using jQuery .attr from the original image source location of \"Images/origImage\" to a new image source lo
This should work in most browsers. Have you used Firebug or something like that to see if the browser is attempting to download the new image? Maybe there is something wrong with the URL (wrong location, not URL encoded, etc)...
I've implemented something similar using the background
style, I wonder if this would help you out. I split out the img variable explicitly:
$("div.xxx").click(function(){
var img = 'path/toNew.jpg';
$('.changesrc').attr('style', 'background: url(' + img + '); ')
});