Given this html,
<div id="knownParent">
<div> <!-- This is the div to delete -->
<a>a link</a>
<span>the <b>keyword</b> is here somewhere and it is not repeated</span>
<p>what I want is to delete the div containing this keyword</p>
</div>
<div id="knownNext"></div>
</div
I need to delete the div “divToDelete“. I always know what is its parent div and its next sibling div and I can determine the div by some keyword in the div’s content.
Using jquery, hoq would I do that?
If you know the parent & the next, you could also do this :
jsfiddle example