Shorter command for search innermost element which contains certain string?

Shorter command for search innermost element which contains certain string?

  1. <div class="one">....
  2. ....
  3. <div class="two">....
  4. ...
  5. <div class="three">.....
  6. <p>
  7. <strong>
  8. blah foobar other text
  9. </strong>
  10. ....
  11. </p>
  12. </div>
  13. ....</div>
  14. ....</div>
I am searching for a shorter (!) way to delete (resp.refer to) the innermost, nested <div> element which contains directly or indirectly in (sub)child elements the string "foobar".

It the sample above only <div> element with class="three" should be removed.

Currently I am using the following command:

  $("div:contains('foobar')").eq(($("div:contains('foobar')").length) - 1).remove();

It works. However it looks plump and artificial.

I can imagine that there is a smarter,shorter way in jQuery.

The command should be applied to all occurencies in a web page.
So if "foobar" appears somewhere else (below) the removal should be applied as well.

Peter