Base element Selector
Copy Code code as follows:
$ ("P")
$ ("P.II") Select all Class=ii p elements
$ ("P#demo") select the first P element of Id=demo
Layered Selector
Copy Code code as follows:
$ ("div input") all input under div
$ ("Div>input")
Basic condition Selector
Copy Code code as follows:
$ ("P:first")
$ ("P:last")
$ ("Tr:even") Select even rows
$ ("tr:odd") odd
$ ("Input:not (: Checked)") Select all elements selected for this selection
$ ("Tr:eq (1)") Table with index value of 1
$ ("tr:gt (0)") greater than 0
$ ("tr:lt (0)") less than 0
$ (": Header") Select All Header elements
$ (": animated") the animation being executed
Content Condition Selector
Copy Code code as follows:
$ ("Div:constains (' ddd ')") Select a layer element that contains DDD text
$ ("Td:empty") Select a table cell that does not contain text or child elements
$ ("Div:has (P)") Select the layer element that contains the paragraph element
$ ("td:parent") Select a table cell that contains child elements or text
Visibility condition Selector
Copy Code code as follows:
$ ("Tr:hidden")//Select all hidden tables
$ ("tr:visible") Select all visible tables
Property Selector
Copy Code code as follows:
$ ("div[id]") Layer with ID attribute
$ ("Input[name= ']") input property name= '
$ ("input[name!= ']")
$ ("input[name^= '") Select the form INPUT element with the Name property and the value "as the starting content"
$ ("input[name$= ']") Select the form INPUT element with the Name property and the value "as End content"
$ ("input[name*= '") select form INPUT element with Name property and value '
$ ("input[id][name$= ']") select an input form element with an ID and name attribute with a value of ' to end content '
Child element Selector
Copy Code code as follows:
$ ("UL Li:nth-child (2)") Select the second list item
$ ("ul Li:nth-child (even)")
$ ("ul Li:nth-child (Odd)")
$ ("ul Li:nth-child (3n)")
$ ("ul Li:first-child")
$ ("ul Li:last-child")
$ ("ul li:only-child") select list appears and only one list item appears
Form element Selector
Copy Code code as follows:
$ ("input") Select all elements such as input textarea Select button
$ (": text") Line of text
$ (":p Assword")
$ (": Radio")
$ (": checkbox")
$ (": Submit")
$ (": Image")
$ (": Reset")
$ (": Button")
$ (": File")
$ (": Hidden")
Form Property Selector
Copy Code code as follows:
$ ("input:enabled")//Select all available
$ ("input:disabled")
$ ("input:checked")
$ ("select:option:selected")