:contains()
containsセレクターは特定の文字列が含まれている要素を検索できるセレクタです。
<ul>
<li id="list0">list0</li>
<li id="list1">list1</li>
<li id="list2">list2</li>
<li id="list3">list3</li>
</ul>
<ul>
<li id="list4">list4</li>
<li id="list5">list5</li>
<li id="list6">list6</li>
<li id="list7">list7</li>
</ul>
次のセレクタでは#list4を含んだjQueryオブジェクトを返します
$("li:contains(list4)")
次のセレクタでは#list0-#list7まで含んだjQueryオブジェクトを返します
$("li:contains(list)")
登録日 : 2012年10月23日 最終更新日 : 2012年10月23日
同じカテゴリー(Selectors)のエントリー
- :disabled
- [attribute~=’value’]
- [attribute|=’value’]
- :animated
- :focus
- :target
- :lang()
- :root
- :only-of-type
- :last-of-type
- :first-of-type
- :nth-last-of-type()
- :nth-of-type()
- :nth-last-child()
- :selected
- :checked
- :file
- :button
- :reset
- :image
- :submit
- :checkbox
- :radio
- :password
- :text
- :input
- :parent
- :has()
- :contains()
- :header
- :lt()
- :gt()
- :eq()
- :odd
- :even
- :last
- :first
- [attributeFilter1][attributeFilter2]
- [attribute*=’value’]
- [attribute$=’value’]
- [attribute^=’value’]
- [attribute!=’value’]
- [attribute=’value’]
- [attribute]
- :not()
- :empty
- :only-child
- :last-child
- :first-child
- 兄弟セレクタ
- 隣接セレクタ
- 子セレクタ
- 子孫セレクタ
- グループセレクタ
- classセレクタ
- idセレクタ
- 要素セレクタ
- ユニバーサルセレクタ