I need to get the img src on button click and only change the value between the first and second forward slashes from "galleryhomelarge" to "testtext".
Js fiddle link: quick setup of my scenario
Jquery Code: `$(function () { var image = ""; var imageSrc = ""; var imageCaption = ""; var newImageCon = ""; var newImageSrc = "";
$('#button').click(function () {
image = $('#demoimg');
imageSrc = image.attr('src');
imageCaption = image.attr('alt');
newImageCon = $('#newimg-con');
newImageCon.html("Old Image Source: " + imageSrc + "<br />Image Caption: " + imageCaption + "<br />New Image Source: " + newImageSrc);
});
}); ` Thanks,
Ian