I tried to get value of image src with click event by using this:
<img onclick='swap(this); return false;' style='width:auto;max-width:65px;max-height:55px' src="/member/sthumb/$image_path_array[$i]">
So when i click it, i get this value /member/sthumb/$image_path_array[$i]
Here is my javascript code:
<script type="text/javascript">
function swap(image) {
...some code to cut the sthumb/ part from the string
document.getElementById("main").src = image.src;
}
</script>
In this javascript code, i would like to cut this specific part sthumb/ out so the image.src will now be: /member/$image_path_array[$i]