huskycyan

webデザインを中心に学習したことを日記として残しています。

jQuery・セレクター一覧

jQuery・学校で9月頃に習ったセレクター一覧

CSSセレクタ

要素セレクター$("要素名")
IDセレクター$("要素名")
クラスセレクター$(".クラス名")         
ユニバーサルセレクター$("*")
子孫セレクター$("要素1 要素2")        
グループセレクター$("セレクター1、セレクター2...")

CSS2.1セレクタ

セレクター$("親要素名>子要素名")     
隣接セレクター$("要素1+要素2")        
first-child疑似クラス$("要素:first-child")      
 
CSS3のセレクタ

間接セレクター$("要素1~要素2")        
否定疑似クラス$("要素1:not(要素2)")       
empty 疑似クラス$("要素:empty")
nth-last-child 疑似クラス$("要素:nth-child(番号)")
last-child 疑似クラス$("要素:last-child")
only-child 疑似クラス$("要素:only-child")
nth-last-child 疑似クラス$("要素:nth-last-child(番号)")
nth-of-type 疑似クラス$("要素:nth-of-type(番号)")
nth-last-of-type 疑似クラス$("要素:nth-last-of-type(番号)")
first-of-type 疑似クラス$("要素:first-of-type")
last-of-type 疑似クラス$("要素:last-of-type")
only-of-type 疑似クラス$("要素:only-of-type")
lang 疑似クラス$("要素:(lang(言語)")

CSSの属性セレクタ

[attribute]$("[属性名]")
[attribute='value']$("[属性名='値']")
[attribute!='value']$("要素名[属性名!='値']")
[attribute^='value']$("[属性名^='値']")
[attribute$='value']$("[属性名$=値']")
[attribute*='value']$("[属性名*='値']")
[attributeFilter1][attributeFilter2] $("[属性名セレクター1][属性セレクター2]")

jQueryの独自のセレクタ

firstセレクター$("要素:first")
lastセレクター$("要素:last")
evenセレクター$("要素:even")
oddセレクター$("要素:odd")
eqセレクター$("要素:eq(番号)")
ltセレクター$("要素:lt(番号)")
gtセレクター$("要素:gt(番号)")
headerセレクター$("header")
containsセレクター$("要素:contains(文字列)")
hasセレクター$("要素1:has(要素2)")
parentセレクター$("要素:parent")
animated$("要素:animated")

フォームセレクタ

chekedセレクター$("要素
checked")
selectedセレクター$("要素
selected")