Filter selector for jQuery learning and jquery filter Selector
: First select the first element: $ ("div: first ")
: Last select the last element: $ ("div: last ")
: Not (selector) retrieves other elements except selector: $ ("div: not (. class )")
: Even: select the element with an even index: $ ("div: even ")
: Odd: elements with an odd index: $ ("div: odd ")
: Eq (index) index equals index: $ ("div: eq (1 )")
: Gt (index) index greater than index: $ ("div: gt (1 )")
: Lt (index) index less than index: $ ("div: lt (1 )")
: Select All tag elements (h1, h2, h3) for header: $ ("div: header ")
: Animated: select all the elements of the animation being executed: $ ("div: animated ")
Content Filter Selector
: Contain (text): $ ("div: contain ('Hello World ')")
: Empty: select an empty element that does not contain child elements or text: $ ("div: empty ")
: Has (selector) selects the element containing the element matched by the selector: $ ("div: has (p )")
: Parent: select an element that contains child elements or text: $ ("div: parent ")
Visibility filter Selector
: Hidden selects invisible elements
: Visible: Select visible elements
Attribute filter Selector
[Attribute] select the element that owns this attribute: $ ("div [align]")
[Attribute = value] elements whose property value is selected: $ ("div [align = center]")
[Attribute! = Value] Select an element whose property value is not value: $ ("div [align! = Center] ")
[Attribute ^ = value] Select an element whose attribute value starts with value: $ ("div [align ^ = center]")
[Attribute $ = value] select the element whose attribute value ends with value: $ ("div [align $ = center]")
[Attribute * = value]: $ ("div [align * = c]")
[Attribute] [attribute] [attribute] the selector merged with the attribute selector: $ ("div [align * = c] [id] [class]")
Child element filter Selector
: Nth-child (index/even/odd/equation) Select the index element under each parent element (starting from 1)
: First-child: select the first child element of each parent element.
: Last-child selects the last child element of each parent element.
: Only-child matches the child element of the parent element with only one child element.
Form object attribute filter Selector
: Enabled: select all available elements
: Disabled: select all unavailable Elements
: Checked select all selected elements (single checked, check box)
: Selected select all selected elements (drop-down list)