I am trying to determine if the src
attribute of an img
tag is empty, and then add a class to another element.
Below is the HTML snippet:
<span class="page-icon"><img src="" width="40" height="40" alt="Privacy" /></span>
If the src
attribute of the image is empty, I want to add the class hide
to the span.page-icon
.