I have some images on my page, but they're all the same image. I'd like to know how I can change them all with jQuery. Below is what I currently have setup.
I have each image with an ID like image-1
, image-2
, etc. and to change them I use
$("#image-1").attr({src:"..."});
$("#image-2").attr({src:"..."});
Is there a way I can just set my ID to myTag
and then change the image src for every image with that id? Because if I were to do this when the method i have now, it'll only change the first image with that id.