:first-of-type セレクタは、その親に対する特定のタイプの最初の子である全ての要素を選択します。
チップ: これは、:nth-of-type(1) に同じです。
チップ: その親に対する特定のタイプの最後の子である全ての要素を選択するには、 :last-of-type セレクタを使用します。
$(":first-of-type")
全 <div> 要素の最初の <p> 要素を選択
全 <div> 要素の最初の <p> 要素を選択する方法。
:first、:first-child、:first-of-type の違い
:first、:first-child、:first-of-type の違い を示します。