I'm surprised no one has mentioned the filter method... From the docs:
filter( expr )
Removes all elements from the set of
matched elements that do not match the
specified expression(s). This method
is used to narrow down the results of
a search...
So, perhaps something like this?
$("table#traffic tr")
.filter(':has(td:contains('" + selected_text + "'))')
.remove();
Of course, you could still use a combination of not
to achieve the same selection (there are many other ways to skin this cat). I just thought I'd mention the filter
function, since that is what it is there for.
Finally, I do also want to point out that none of the approaches answered thus far address the very likely situation where you will end up removing rows you don't want to! For example, if a row has multiple cells, you don't want just one of those cells in the row not containing your text to cause the whole row to be removed! Note that in my solution above, filtering is done on the row-level, not the cell-level. (I haven't tested this so please don't jump on me if this doesn't work exactly as is!)
Best of luck!
-Mike