| Selector | Example | Selects |
| * | $("*") | All elements |
| #id | $("#lastname") | The chemical ingredient amongst id="lastname" |
| .class | $(".intro") | All elements amongst class="intro" |
| .class,.class | $(".intro,.demo") | All elements amongst the shape "intro" or "demo" |
| element | $("p") | All <p> elements |
| el1,el2,el3 | $("h1,div,p") | All <h1>, <div> too <p> elements |
| | |
| :first | $("p:first") | The start out <p> element |
| :last | $("p:last") | The concluding <p> element |
| :even | $("tr:even") | All fifty-fifty <tr> elements |
| :odd | $("tr:odd") | All strange <tr> elements |
| | |
| :first-child | $("p:first-child") | All <p> elements that are the start out kid of their parent |
| :first-of-type | $("p:first-of-type") | All <p> elements that are the start out <p> chemical ingredient of their parent |
| :last-child | $("p:last-child") | All <p> elements that are the concluding kid of their parent |
| :last-of-type | $("p:last-of-type") | All <p> elements that are the concluding <p> chemical ingredient of their parent |
| :nth-child(n) | $("p:nth-child(2)") | All <p> elements that are the sec kid of their parent |
| :nth-last-child(n) | $("p:nth-last-child(2)") | All <p> elements that are the sec kid of their parent, counting from the concluding child |
| :nth-of-type(n) | $("p:nth-of-type(2)") | All <p> elements that are the sec <p> chemical ingredient of their parent |
| :nth-last-of-type(n) | $("p:nth-last-of-type(2)") | All <p> elements that are the sec <p> chemical ingredient of their parent, counting from the concluding child |
| :only-child | $("p:only-child") | All <p> elements that are the solely kid of their parent |
| :only-of-type | $("p:only-of-type") | All <p> elements that are the solely child, of its type, of their parent |
| | |
| parent > child | $("div > p") | All <p> elements that are a straight kid of a <div> element |
| parent descendant | $("div p") | All <p> elements that are descendants of a <div> element |
| element + next | $("div + p") | The <p> chemical ingredient that are side yesteryear side to each <div> elements |
| element siblings | $("div p") | All <p> elements that are siblings of a <div> element |
| | |
| :eq(index) | $("ul li:eq(3)") | The 4th chemical ingredient inward a listing (index starts at 0) |
| :gt(no) | $("ul li:gt(3)") | List elements amongst an index greater than 3 |
| :lt(no) | $("ul li:lt(3)") | List elements amongst an index less than 3 |
| :not(selector) | $("input:not(:empty)") | All input elements that are non empty |
| | |
| :header | $(":header") | All header elements <h1>, <h2> ... |
| :animated | $(":animated") | All animated elements |
| :focus | $(":focus") | The chemical ingredient that currently has focus |
| :contains(text) | $(":contains('Hello')") | All elements which contains the text "Hello" |
| :has(selector) | $("div:has(p)") | All <div> elements that accept a <p> element |
| :empty | $(":empty") | All elements that are empty |
| :parent | $(":parent") | All elements that are a nurture of roughly other element |
| :hidden | $("p:hidden") | All hidden <p> elements |
| :visible | $("table:visible") | All visible tables |
| :root | $(":root") | The document's origin element |
| :lang(language) | $("p:lang(de)") | All <p> elements amongst a lang attribute value starting amongst "de" |
| | |
| [attribute] | $("[href]") | All elements amongst a href attribute |
| [attribute=value] | $("[href='default.htm']") | All elements amongst a href attribute value equal to "default.htm" |
| [attribute!=value] | $("[href!='default.htm']") | All elements amongst a href attribute value non equal to "default.htm" |
| [attribute$=value] | $("[href$='.jpg']") | All elements amongst a href attribute value ending amongst ".jpg" |
| [attribute|=value] | $("[title|='Tomorrow']") | All elements amongst a championship attribute value equal to 'Tomorrow', or starting amongst 'Tomorrow' followed yesteryear a hyphen |
| [attribute^=value] | $("[title^='Tom']") | All elements amongst a championship attribute value starting amongst "Tom" |
| [attribute =value] | $("[title ='hello']") | All elements amongst a championship attribute value containing the specific discussion "hello" |
| [attribute*=value] | $("[title*='hello']") | All elements amongst a championship attribute value containing the discussion "hello" |
| | |
| :input | $(":input") | All input elements |
| :text | $(":text") | All input elements amongst type="text" |
| :password | $(":password") | All input elements amongst type="password" |
| :radio | $(":radio") | All input elements amongst type="radio" |
| :checkbox | $(":checkbox") | All input elements amongst type="checkbox" |
| :submit | $(":submit") | All input elements amongst type="submit" |
| :reset | $(":reset") | All input elements amongst type="reset" |
| :button | $(":button") | All input elements amongst type="button" |
| :image | $(":image") | All input elements amongst type="image" |
| :file | $(":file") | All input elements amongst type="file" |
| :enabled | $(":enabled") | All enabled input elements |
| :disabled | $(":disabled") | All disabled input elements |
| :selected | $(":selected") | All selected input elements |
| :checked | $(":checked") | All checked input elements |
Comments
Post a Comment