The correct way to do this is:
$("tr td:nth-child(2):contains('value')").each(function(){ alert($(this).parent().attr("id")); });
Why didn’t it work the way you wrote it? Since from the first selector you get td, which has the word "meaning" in it, and td has the word "something" in it. After getting this choice, running .find ("...") on these elements starts looking for elements inside what you have. Since both tds do not contain any other element, this .find () selector does not return anything.
source share