JSFiddle - React, Tailwind, and code Playground
HTML
<table id="mytableid">
<tbody>
<tr>
<td>cell 1-1</td>
<td>cell 1-2</td>
<td>cell 1-3</td>
<td>cell 1-4</td>
<td>cell 1-5</td>
<td>cell 1-6</td>
<td>cell 1-7</td>
<td>cell 1-8</td>
<td>cell 1-9</td>
<td>cell 1-10</td>
<td>cell 1-11</td>
<td>cell 1-12</td>
</tr>
<tr>
<td>cell 2-1</td>
<td>cell 2-2</td>
<td>cell 2-3</td>
<td>cell 2-4</td>
<td>cell 2-5</td>
<td>cell 2-6</td>
<td>cell 2-7</td>
<td>cell 2-8</td>
<td>cell 2-9</td>
<td>cell 2-10</td>
<td>cell 2-11</td>
<td>cell 2-12</td>
</tr>
</tbody>
</table>
JavaScript
function getCellValue(infoId) {
let output = "";
document.querySelectorAll("#mytableid>tbody>tr>td").forEach(elem => {
if (elem.textContent.includes(infoId)) {
output = elem.parentNode.querySelectorAll('td')[11].innerHTML;
}
});
return output;
}
console.log(getCellValue("cell 2-1"))