<div id="tab">
<div class="" style="margin: 10px;">
<div id="someVerylongId1" style="height: 400px; position: relative;">
</div>
</div>
<div class="" style="margin: 10px;">
<div id="someVerylongId2" style="height: 400px; position: relative;">
</div>
</div>
<div class="" style="margin: 10px;">
<div id="someVerylongId3" style="height: 400px; position: relative;">
</div>
</div>
<div>
Run Code Online (Sandbox Code Playgroud)
我想选择所有不指定id或检查任何其他属性的div,是否可以这样做?
这是我的尝试:
$("#tab div div")
Run Code Online (Sandbox Code Playgroud)
但看起来是选择不完全正确.需要帮忙.
问题是,我的选择器返回了应该有的更多元素
我有桌子
<table>
<tr>
<td colspan="3"></td>
</tr>
<tr> //select this
<td></td>
<td></td>
<td></td>
</tr>
<tr> //select this
<td></td>
<td></td>
<td></td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
所以对于上表我想选择包含3个tds的所有trs
我怎么能用jquery做到这一点?
基本上我需要得到这些行的计数.