How to hide span if there is no text even though there already is an embedded image? Basically there are little web icon and video icon embedded like this in each span..
Visit website(webicon) View Video(videoicon) so if ----no link text---(EMBEDDED WEBICON), the whole thing including the image icon should hide..
<div class="profile-links">
<!--visit website,watch video links-->
<span class="website"><SharePointWebControls:UrlField FieldName="VISIT WEBSITE" runat="server">
</SharePointWebControls:UrlField></span> <img class="website" src="/Style Library/Images/design/icons/icon-www.png" alt="WebSite" />
<span class="video"><SharePointWebControls:UrlField FieldName="WATCH VIDEO" runat="server">
</SharePointWebControls:UrlField></span><img src="/Style Library/Images/design/icons/icon-video-teal.png" alt="Video" />
</div>
This will hide all of the span elements with a class of 'website':
$(function() {
$('span.website').hide();
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With