I'd like to replace the 2's with 1's for the image src in all matching classes. I've tried something similar for specific elements and thats works, but I can't get it to work for all matching classes. How do I change the format of the first call so it works? Thanks.
$(".in1, .in2, .in3").click(
function()
{
$(".in1, .in2, .in3").attr("src").replace("2","1");// This doesn't work
if(this.src.indexOf("1")!=-1){
this.src = this.src.replace("1","2"); // This works
}else{
this.src = this.src.replace("2","1"); // This works
}
}
);