#id:選取指定 id 的元素,如 $("#id1")。.class:選取指定 class 的元素。element:選取指定標籤名的所有元素。*:比對所有元素。selector1, selector2, ...:多選,以逗號分隔,可以是 class 或 id。$("ancestor descendant"):選取 ancestor 底下所有後代 descendant。$("parent > child"):只選取 parent 底下第一層的子元素 child。$('prev + next'):選取緊接在 prev 之後的第一個 next。$('prev ~ siblings'):選取 prev 之後的所有同層 siblings。其中 $('prev + next') 的效果等同 $(.prev).next("next");$('prev ~ siblings') 等同 $(.prev).nextAll("siblings")。
:first:第一個元素,如 $("div:first")。:last:最後一個元素。:not(selector):不符合 selector 的元素。:even:索引為偶數的元素。:odd:索引為奇數的元素。:eq(index):索引等於 index 的元素。:gt(index):索引大於 index 的元素。:lt(index):索引小於 index 的元素。:header:所有標題元素(h1~h6)。:animated:所有正在跑動畫的元素。:contains(text):含有指定文字的元素,如 $("div:contains('hello')")。:empty:不含任何內容(含子節點)的元素。:has(selector):內部含有符合 selector 的元素者。:parent:含有子元素的元素。:hidden:所有不可見元素。:visible:所有可見元素。[attribute]:擁有該屬性的元素,如 $("div[id]")。[attribute=value]:屬性值等於 value。[attribute!=value]:屬性值不等於 value。[attribute^=value]:屬性值以 value 開頭。[attribute$=value]:屬性值以 value 結尾。[attribute*=value]:屬性值含有 value。[selector1][selector2]...:同時滿足多個條件的組合。:nth-child(index/even/odd/equation):父元素底下符合索引、偶數、奇數或公式的子元素。:first-child:父元素的第一個子元素。:last-child:父元素的最後一個子元素。:only-child:父元素底下唯一的子元素。:enabled:所有可用元素,如 $("#form1:enabled")。:disabled:所有被停用的元素。:checked:所有被勾選/選取的元素。:selected:所有被選中的 option。:input:所有 <input>、<textarea>、<select>、<button>。:text:單行文字輸入框;以下皆為同類寫法。:password、:radio、:checkbox、:submit、:image、:reset、:button、:file、:hidden。把這九類記熟,日常選取元素時幾乎不用再去翻文件。