Replace Content )f Source Attribute
HTML
<div class="div1">
<p>this is modified</p>
<img src="https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-xtf1/t31.0-8/12605316_995354503864218_3990892340781902470_o.jpg" />
</div>
<div class="div2">
<p>this is not modified</p>
<img src="https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-xtf1/t31.0-8/12605316_995354503864218_3990892340781902470_o.jpg" />
</div>
JavaScript
//modify src URL to pull in different image size
$('.div1>img').attr('src',function(i,e){
return e.replace("s.jpg","o.jpg");
})
// $('.div1>img:contains(s.jpg)').each(function(){
// $(this).html(
// $(this).html().replace('s.jpg','o.jpg')
// );
//});
// get image dom element
//var img = document.getElementById('imageId');
// update src
//img.src = img.src.replace(/s.jpg/, 'o.jpg');