Hi, I'm using selectorgadget to help me select elements on the document. But when I used it on jQuery it doesn't work. The nth-child selector seems not to work for me.
<div id = "wrap">
<div class = "book">
<div class = "chapter">
<p class = "text">
<table>
<tbody>
<tr>
<td>Title</td>
<td>
<b>jQuery</b>
</td>
</tr>
</tbody>
</table>
<p>
</div>
</div>
</div>
The HTML is above. There are many book class. The div wrap is the wrapper that enclosed them all. Selector Gadget said that when I use:
$("#wrap tr:nth-child(1) b")
It should select the TD element with the <b>
tag in it. So it should select "jQuery".
I tried it, but it didn't work. When I tried:
var query = $("#wrap tr:nth-child(1) b").text();
alert(query);
The browser sends an alert with no text. And when I tried:
var query = $("#wrap tr:nth-child(1) b").html();
alert(query);
The browser sends a NULL alert.
What's wrong?