I have a table on my page html :
<table id="myTab">
<tr>
<td class="reference">1</td>
<td>item1</td>
<td>Info item - 1</td>
</tr>
<tr>
<td class="reference">2</td>
<td>item2</td>
<td>Info item - 2</td>
</tr>
<tr>
<td class="reference">3</td>
<td>item3</td>
<td>Info item - 3</td>
</tr>
<tr>
<td class="reference">4</td>
<td>item4</td>
<td>Info item - 4</td>
</tr>
<table>
How I can select an element of my table with class reference innerHtml value=3?
var el = $(myTab).find('???')
Assuming you want a reference to just that
tdelement, and the markup you’ve shown is the extent of your current structure, you can use the:containsselector:If you have other
tdelements containing the character3(e.g.13) they will also be matched. In that case, it’s probably better to use the.filter()method: