Reputation: 77
I am using an RSS feed to display weather from an external source on my website. I would like to be able to change/swap out the images in the feed for my own images. The only thing that makes each image unique is its Alt tag.
<p>
<b>Tuesday:</b>
<br>
<img alt="Sunny" src="http://www.weather.com.au/images/icons/1.gif">
<br>
Sunny. Warm.
<br>
20 - 28
<br>
</p>
So, is there a way to recognize that the Alt tag is "Sunny", and replace this image with one of my own?
Upvotes: 1
Views: 171
Reputation: 19539
Don't be afraid to reference the manual.
$('img[alt="Sunny"]').attr('src', someUrl);
Upvotes: 1