Hi,
I have the following script which pulls an image source name and then outputs just the file name.
What I now want to do in addition to the below is to replace specific image names with another, for example, if the image name is IMAGE1.jpg, I want to replace it with IMAGE20.jpg and also dropping the .jpf file extension.
What would be the best way to do this based on the below?
$(".picture img").each(function () {
var caption = $(this).attr('src').replace(/\\.jpg/, '').split('/').pop();
$(this).parent().next().text(caption);
});
Thanks