Hi guys,
I’m new to Jscript but trying to combien it with CSS to build a website. I need to do the following:
1) Read the img src property in the mainPicture DIV
2) Replace a string in the actual name of the image
3) Store the new result and pathname
The code I have so far is this:
function getPic(){
var currentPicture = document.getElementById(“mainPicture”).getElementsByTagName(“img”)[0].src;
alert(currentPicture);
}
This works well for part 1, but gives me the path of the image *relative
For part 2, what code do I write to take the string pic1_[B][I]before[B][I]after
For part 3, how do I then save the whole string /images/pic1_after.jpg? I will be applying it somewhere else.
Hope this makes sense and thanks in advance for helping.
milton