I. Basic selector 1.id selector $ ("#id"). CSS ("Background", "#fffff"), 2.class selector, check Class=mini element $ (". Mini"). CSS ("Background", "# Fffff "); 3. Tag Selector, select the div tag element $ (" div "). CSS (" Background "," #fffff "); 4. All selectors, select all SELECT elements $ (" * "). CSS (" Background "," #fffff " ); 5. Parallel selector, select the two elements of Id=id and Class=mini $ ("#id,. Mini") ("Background", "#fffff"); two. Basic filter selector 1. Gets the first child element in all TR under table $ ("Table tr:first"). CSS ("Background", "#fffff"); 2. Gets the last child element in all TR under Table $ ("Table tr:last"). CSS (" Background "," #fffff "); 3. Get all the sub-elements under table with a TR index greater than 3 (" TABLE&NBSP;TR:GT (3) "). CSS (" Background "," #fffff "); 4. Get all the TR indexes under table below 3 for the child element $ ("Table tr:lt (3)"). CSS ("Background", "#fffff"), 5. Gets all the TR indexes under table equal to 3 child elements $ ("table tr:eq (3) "). CSS (" Background "," #fffff "), 6. Gets all the TR indexes under table equal to the even number of child elements $ (" Table tr:even "). CSS (" Background ", "#fffff"); 7. Get all the TR indexes under table equal to the odd number of child elements $ ("table tr:odd"). CSS ("Background", "#fffff"), 8. Get all the TR under table and class!= All child elements of one $ ("Table tr:not (. One)"). CSS ("Background", "#fffff"); 9. Gets the elements of the title tag such as: h1,h2,h3$ (": Header"). CSS (" Background "," #fffff "); 10. Gets all the elements that are currently performing the animationVegetarian $ (": animalted"). CSS ("Background", "#fffff"); 11. Gets the element that is currently getting focus $ (": Focus"). CSS ("Background", "#fffff"); three. Hierarchy Selector siblings prve prveall next nextAll Closet1. Gets the body under all DIV elements $ ("Body div"). CSS ("Background", "#fffff"); 2. Gets the first generation of child nodes under the body $ ("Body > div "). CSS (" Background "," #fffff "); 3. Gets all class=one immediately adjacent to the first DIV element (peers and child nodes, which one?) $ (". One + div"). CSS ("Background", "#fffff"); 4. Get all the div sibling elements after all Class=one (package does not include child nodes?) $ (". One ~ div"). CSS ("Background", "#fffff"); four. Content Filter selector 1. All DIV elements within the label text contain all div elements of Di ("Div:contains (DI) "). CSS (" Background "," #fffff "); 2. All DIV elements without child elements $ (" Div:empty "). CSS (" Background "," #fffff "); 3.class= All DIV elements for mini $ ("Div:has (. Mini)"). CSS ("Background", "#fffff"); 4. All DIV elements containing child elements $ ("div:parent"). CSS ("Background", "# Fffff "); Five. Child element filter Selector 1. Gets the second child element of the Class=one div (" Div.one :nth-child (2) "). CSS (" Background "," #fffff "); 2. Gets the first child element of the Class=one div (" Div.one :first-child "). CSS (" Background "," #fffff "); 3. Get Class=onE div Last child element $ ("Div.one :last-child"). CSS ("Background", "#fffff"); 3. Gets the unique child element of the Class=one div $ (" Div.one :only-child "). CSS (" Background "," #fffff "); six. Property Filter selector 1. Contains the title property of all DIV elements $ (" div[title] "). CSS (" Background "," #fffff "); 2.id=one all DIV elements $ (" Div[id=one] "). CSS (" Background "," #fffff "); 3.id!=one all DIV elements $ (" div[id!= One]). CSS ("Background", "#fffff"); 4.id all DIV elements beginning with one such as id=onecall$ ("Div[id^=one]"). CSS ("Background", "#fffff"); 5.id all DIV elements ending with one example: id=callone$ ("Div[id$=one]"). CSS ("Background", "#fffff"), 6.title with all DIV elements in the worth in a space separate from the UK For example title= ' One uk ' $ ("Div[title~=uk]"). CSS ("Background", "#fffff"); 7.id attribute contains all div elements of one $ ("Div[id*=one]" ). CSS ("Background", "#fffff"), 8.id attributes all div elements prefixed with en (followed by '-') For example: Id= ' En-uk ' $ ("div[id|=en]"). CSS ("background "," #fffff "); 9. Combo Selector contains the id attribute and the title contains all DIV elements of one (" Div[id][title*=one] "). CSS (" Background "," #fffff "); Seven. Visibility filter Selector 1. All visible div elements $ ("div:visible"). CSS ("Background", "#fffff"); 2. All Hidden div elements $ ("Div:hidden"). CSS (" Background "," #fffff "); Eight. Form selector 1.$ ("Form :image") $ ("Form :button") <button ></button> and <input type= "button" /> can be selected for $ ("form :riado ") <input type= ' Radio '/>$ (" Form :reset ") <input type = ' Reset '/>$ ("Form :hidden") <input type= "hidden"/> and <div Style= "Display:none" ></div> can be selected $ ("Form :text") <input type= ' text '/ >$ ("Form :file") <input type= ' file '/>$ ("Form select") <select> <option></option></select>$ ("Form textera") <textera></textera> Nine. Form Properties Filter Selector 1. All selected input elements $ ("input:checked") 2. All disabled input elements $ ("input:disabled") 3. All available input elements $ ("input:enabled") 4. All selected selected elements $ ("select :selected")
JQuery Selector Rollup