When using :nth-of-type(n) to make a selection it does not return the expected response.
I'm wanting to select the second <td> element with className b.
Why when using selector .b:nth-of-type(2) yield no result?
<div id="foot">
<table id="nav">
<tbody>
<tr valign="top">
<td class="b"><b>Previous</b></td>
<td><b>1</b></td>
<td><a href="#">2</a></td>
<td><a href="#">3</a></td>
<td><a href="#">4</a></td>
<td><a href="#">5</a></td>
<td><a href="#">6</a></td>
<td><a href="#">7</a></td>
<td><a href="#">8</a></td>
<td><a href="#">9</a></td>
<td><a href="#">10</a></td>
<td class="b"><a href="#">Next</a></td>
</tr>
</tbody>
</table>
</div>
Stipulations
- The number of
<td>elements can change. - pure JavaScript/CSS only.
Although .b:nth-last-child(1) would work,
this question is to understand why .b:nth-child(2) does not return the same.