I have couple of tags which has same “name” attribute. Something like this:
<img name="pic1" src="" />
<img name="pic1" src="" />
<img name="pic1" src="" />
Now, I would like to replace the src of all images which has same “name”. How can I do this using Jquery.
Thanks in advance.
First of all, you should not use the
nameattribute on images. Instead, use theclassattribute.Then you would do something like this:
If you would want to check the current source, you would have to take another approach: