I need to replace a list of image src in a div tag.
For instance :
<!-- language-all: lang-html -->
<div id="Listofimages">
<img src="images\2page_img_3.jpg">
<img src="images\2page_img_3.jpg">
<img src="images\2page_img_3.jpg">
</div>
So here i want to change these 3 image source.
Another Demo http://jsfiddle.net/ac52D/
Good read: http://api.jquery.com/prop/
Little explanation:
below code takes all the
imgtag insidedivwith idListofimagesand changes its img src.The demo contains before and after alerts.
Hope this helps,
code
HTML