jQuery :only-of-type セレクタ

❮ jQuery Selectors

親に <p> 要素が 1 つだけの各 <p> 要素を選択する:

$("p:only-of-type")
Try it Yourself »

定義と用法

:only-of-type selector セレクタは、親要素に対して特定のタイプの子が 1 つしかない 全ての要素を選択します。


構文

$(":only-of-type")

❮ jQuery Selectors