I have a div which basically looks like this:
<div class="wrapper">
<img src="#" />
<a href="#" class="link"> SomeText </a>
<a href="#" class="provider"> SomeText </a>
<div class="description">Text Text Text</div>
</div>
As you can see the text within .provider is the same as in .link
My question is: How do I remove the whole div (.wrapper) if there is such a duplicate of text? Please note the text is not set, it could be anything, so therefore its a var:
var text = $('.provider').text();
$('.wrapper a:contains(text)').remove();
This is one of my many attempt with no luck.
this should do the job:
(example: http://jsfiddle.net/8b655/)