セレクタ (selector)

メモ

  • CSSのセレクタを模し、独自セレクタを追加
  • 属性セレクタは、下記の記述が可能
    • $( 'a[href=""]' )
    • $( "a[href='']" )
    • $( 'a[href=\'\']' )
    • $( "a[href=\"\"]" )

一覧

表示種別説明
属性セレクタ (Attribute)
基本セレクタ (Basic)
基本フィルタ (Basic Filter)
フィルタ (Child Filter)
コンテンツ フィルタ (Content Filter)
フォームセレクタ (Form)
階層フィルタ (Hierarchy)
jQuery 拡張 (jQuery Extensions)
表示状態フィルタ (Visibility Filter)

(jQuery$として記述)
種別セレクタ概要構文
Basic全要素$( "*" ) 1.0
Basicクラス指定要素$( ".class【クラス名】" ) 1.0
Basicタグ要素$( "element【タグ名】" ) 1.0
Basicid 指定要素$( "#id【id】" ) 1.0
Hierarchy子要素 $( "parent【親】 > child【子】" ) 1.0
Hierarchy子孫要素 $( "ancestor【先祖】descendant【子孫】" ) 1.0
Hierarchy隣接兄弟要素 $( "prev【兄要素セレクタ】 + next【弟要素セレクタ】" ) 1.0
Hierarchy一般兄弟要素 $( "prev【兄要素セレクタ】 ~ siblings【弟要素セレクタ】" ) 1.0
Basic複数要素 (OR) $( "selector1【セレクタ1】, ~ selectorN【セレクタN】" ) 1.0
Attribute属性 (存在) $( "[attribute【属性名】]" ) 1.0
Attribute属性 (完全一致) $( "[attribute【属性名】='value【属性値】']" ) 1.0
Attribute属性 (先頭一致) $( "[attribute【属性名】^='value【属性値】']" ) 1.0
Attribute属性 (末尾一致) $( "[attribute【属性名】$='value【属性値】']" ) 1.0
Attribute属性 (部分一致) $( "[attribute【属性名】*='value【属性値】']" ) 1.0
Attribute属性 (リスト項目一致) $( "[attribute【属性名】~='value【属性値】']" ) 1.0
Attribute属性 (プレフィックス) $( "[attribute【属性名】|='value【属性値】']" ) 1.0
Attribute
Extensions
属性 (否定) $( "[attribute【属性名】!='value【属性値】']" ) 1.0
Attribute複数属性 (AND) $( "[attributeFilter1【属性フィルタ1】]~[attributeFilterN【属性フィルタN】]" ) 1.0
B_Filter
Extensions
アニメーション中 要素 $( ":animated" ) 1.2
Form
Extensions
ボタン要素$( ":button" ) 1.0
Form
Extensions
チェックボックス要素 $( ":checkbox" ) 1.0
Formチェック状態・選択状態 要素$( ":checked" ) 1.0
Content指定テキストを含む要素 $( ":contains(text)" ) 1.1.4
Form無効状態要素$( ":disabled" ) 1.0
Content空要素$( ":empty" ) 1.0
Form有効状態要素$( ":enabled" ) 1.0
B_Filter
Extensions
インデックス要素 (一致) $( ":eq(index)" ) 1.0
$( ":eq(-index)" ) 1.8
B_Filter
Extensions
インデックス要素 (偶数) $( ":even" ) 1.0
Form
Extensions
ファイルタイプ要素$( ":file" ) 1.0
B_Filter
Extensions
先頭要素$( ":first" ) 1.0
Child先頭の子要素$( ":first-child" ) 1.1.4
Child先頭の該当子要素$( ":first-of-type" ) 1.9
B_Filter
Form
フォーカス要素$( ":focus" ) 1.6
B_Filter
Extensions
インデックス要素 (より大きい) $( ":gt(index)" ) 1.0
$( ":gt(-index)" ) 1.8
Content
Extensions
指定子孫要素を持つ要素 $( ":has(selector【セレクタ】)" ) 1.1.4
B_Filter
Extensions
ヘッダ要素$( ":header" ) 1.2
Extensions
Visibility
非表示要素 $( ":hidden" ) 1.0
Form
Extensions
イメージボタン要素$( ":image" ) 1.0
Form
Extensions
各種入力要素$( ":input" ) 1.0
B_Filter言語属性要素 $( ":lang(language【言語コード】)" ) 1.9
B_Filter
Extensions
最終要素$( ":last" ) 1.0
Child最終の子要素$( ":last-child" ) 1.1.4
Child最終の該当子要素$( ":last-of-type" ) 1.9
B_Filter
Extensions
インデックス要素 (より小さい) $( ":lt(index)" ) 1.0
$( ":lt(-index)" ) 1.8
B_Filter否定要素 $( ":not(selector【セレクタ】)" ) 1.0
Childan+b番目の子要素 $( ":nth-child(index / even/odd / an + b)" )  1.1.4
Child末尾からan+b番目の子要素 $( ":nth-last-child(index / even / odd / an + b)" )  1.9
Child末尾からan+b番目の該当子要素 $( ":nth-last-of-type(index / even / odd / an + b)" )  1.9
Childan+b番目の該当子要素 $( ":nth-of-type(index / even / odd / an + b)" )  1.9
B_Filter
Extensions
インデックス要素 (奇数) $( ":odd" ) 1.0
Child唯一の子要素$( ":only-child" ) 1.1.4
Child唯一の該当子要素$( ":only-of-type" ) 1.9
Content
Extensions
中身有り要素 $( ":parent" ) 1.0
Form
Extensions
パスワード要素$( ":password" ) 1.0
Form
Extensions
ラジオボタン要素$( ":radio" ) 1.0
Form
Extensions
リセットボタン要素$( ":reset" ) 1.0
B_Filterドキュメント ルート要素$( ":root" ) 1.9
Form
Extensions
選択状態要素$( ":selected" ) 1.0
Form
Extensions
送信ボタン要素$( ":submit" ) 1.0
B_FilterURIターゲット属性 対応要素 $( ":target" ) 1.9
Form
Extensions
テキストタイプ要素$( ":text" ) 1.0
Extensions
Visibility
表示要素$( ":visible" ) 1.0

関連