hide link image if the link itself is using jquery?

there is a link and right next to it is a link image embedded. Like 'driving direction + car image"' if there is no 'driving direction' text for link, hide the care image icon embedded.. How do you do that in jquery?? please someone?

<span class="website">
<a href="http://www.google.com">Visit My Website</a>
</span> 
<img class="websiteimage" src="/Style Library/Images/design/icons/icon-www.png" alt="WebSite" />

so basically check if a tag has any text in it and if its empty hide the img tag embedded pic

Answers


No idea if this works, but here's what I would try:

$('img').each(function() {
  if ($(this).prev('span.website').find('a').text() == '') {
    $(this).hide();
  }
});

Need Your Help

Spring Data Neo4j template.fetch() leading to OutOfMemory?

neo4j spring-data-neo4j

Is there a theoretical possibility that using template.fetch() could lead to OutOfMemoryException? Let's say for example that there is a loop that loops 100 times and each time template.fetch() is

Full Build, Incremental Build and Deploy within Powerbuilder

deployment build powerbuilder powerbuilder-build-deploy

What is the difference between a Full Build, an Incremental Build and Deploy within Powerbuilder? The only difference I can see is that Deploy allows you to update the PBDs for, well, deployment.