Is there a way to make the source image of an img tag transparent, allowing the background image to show through?
For example, if I have this html:
<img src="my_image.jpg" height="200" width="300" style="background:url(img/bg.jpg) repeat;" />
I am looking for a way to target the source image and set its opacity to 0.7.
With jQuery, one approach could involve copying the src, height, and width attributes of the image and changing the markup to something like this:
<div style="background:url(img/bg/jpg) repeat; height:200px; width:300px;">
<div style="background:url(my_image.jpg); height:200px; width:300px; opacity:0.7;"></div>
</div>
However, I am wondering if there is a simpler or better method to achieve this without manipulating the markup directly.