I'm looking for a way to add an underscore to a filename (and remove "_" from sibling) so it'll show a new "clicked" image.
for example:
Beginning with "my_image1_.png" (which means it's clicked), I want when I click on "my_image2.png" to change to "my_image2_.png"
Thanks in advance!
$('.img_icons_result').click(function(){
$(this).html($(this).html().replace('_.png', '.png'))
return false;
});
<img src="img/icons/my_image1.png" class="img_icons_result" />
<img src="img/icons/my_image2.png" class="img_icons_result" />
<img src="img/icons/my_image3.png" class="img_icons_result" />
<img src="img/icons/my_image4.png" class="img_icons_result" />