I have a bunch of text that looks like this
<div id="justThisDIV"><p>Some paragraph <img src="http://mydomain.com/image.jpg"/> </p>
<p><img src="http://mydomain.com/wow.png"/></p>
<p><img src="http://notmydomain.com/blah.png"/> Wow this is boring</p></div>
Is there a way to assign a class to all images from my domain, meaning those with the URL mydomain.com within the DIV having the ID justThisDIV
I attempted the following without success
<script type="text/javascript">
$(document).ready(function() {
$("div#justThisDIV img[src*=mydomain.com]").addClass("full-width");
});
</script>
Thank you