This code is working, but I think it’s anchoring on the wrong tag. Here I believe it’s saying on the first match of aaaaa, return the cell value for the next div, because it happens to be under a dive. But now that I also want to pull the value of 3rd td on a match. How can I change this code so that I can use it get both of the subsequent cells when a match is found.
var bodyprefix = $('#issuetbl td:contains(aaaa)').siblings().find('div').html();
For example, given aaaa, I want var1=whatever and var2=cccc
I’m okay with running it twice, but would like the same function based on index or nth-child.
<tr>
<td>aaaa</td>
<td><div>whatever</div></td>
<td>cccc</td>
</tr>
<tr>
<td>1111</td>
<td><div>something</div></td>
<td>2222</td>
</tr>
Use
nextAllinstead ofsiblings:bodyprefixesis now an array of all the values.