JSFiddle - React, Tailwind, and code Playground
HTML
<table class="test">
<tr>
<td>Section Heading 1</td><td>Section Text 1</td>
</tr>
<tr>
<td>Section Heading 2</td><td>Section Text 2</td>
</tr>
<tr>
<td>Section Heading 3</td><td>Section Text 3</td>
</tr>
<tr>
<td>Section Heading 4</td><td>Section Text 4</td>
</tr>
<tr>
<td>Section Heading 5</td><td>Section Text 5</td>
</tr>
</table>
JavaScript
$(function() {
var searchText = "Section Heading 3";
var output = "";
$("td").each(function(i, item) {
if($(item).html() == searchText) {
output = $(item).html();
output += $(item).closest("td").html()
}
});
console.log(output);
});