jQuery :first-childセレクター
定義と使い方
:first-child セレクターは、親要素の最初の子要素を選択します。
ヒント:セレクターを使用して:last-child親要素の最後の子要素を選択してください。
構文
$(":first-child")
試してみる - 例
すべての <div> 要素の最初の <p> 要素を選択します
すべての <div> 要素の最初の <p> 要素を選択する方法。
:first と :first-child の違い
:first と :first-child セレクターの違いをデモします。
:first、:first-child、:first-of-type の違い
:first、:first-child、:first-of-type セレクターの違いをデモします。
その他の拡張
jQuery セレクター