You can use filter() to do that:
var tableRow = $("td").filter(function() {
return $(this).text() == "foo";
}).closest("tr");
You can use filter() to do that:
var tableRow = $("td").filter(function() {
return $(this).text() == "foo";
}).closest("tr");