道胡子 發表於 2020-10-13 15:33:00

jquery选择器,节点函数

<h3 id="附近节点获取">附近节点获取</h3>
<ol>
<li>父节点</li>
</ol>
<pre><code class="language-js">$().parent(); // 直接父节点
$().parents('tr:first'); // 第一个tr父节点
</code></pre>
<ol start="2">
<li>子节点</li>
</ol>
<pre><code class="language-js">$().children();
$().find(':checkbox'); // CheckBox的子节点
</code></pre>
<ol start="3">
<li>兄弟节点</li>
</ol>
<pre><code class="language-js">$().prev(); //
$().prevAll();
$().next();
$().nextAll();
</code></pre><br><br>
来源:https://www.cnblogs.com/zhuxiang1633/p/13809175.html
頁: [1]
查看完整版本: jquery选择器,节点函数