JQuery remove image src prefix
- by mtwallet
Hi. I have a bunch of images on a page that are contained within a div with a class of content-block like this:
<div class="content-block">
<img src="../images/path/path/image.jpg" alt="blah" title="blah" />
<img src="../images/path/path/image.jpg" alt="blah" title="blah" />
<img src="../images/path/path/image.jpg" alt="blah" title="blah" />
<img src="../images/path/path/image.jpg" alt="blah" title="blah" />
<img src="../images/path/path/image.jpg" alt="blah" title="blah" />
</div>
I am loading this html into a div via ajax. When I load it in I need to remove the "../" before the image path, after it loads in so the path remains correct. Can this be done with JQuery? Many thanks in advance.