During page developmentHighlight the needs of a specific row. AlthoughBasic filter Selector: Eq (INDEX) can be used to display a single table,It cannot meet the selection needs of a large amount of data and multiple tables. To implement this function, you can useChild element filter SelectorIt is easy to obtain an element specified in all parent elements.
Sub-element filter selector syntax
Selector |
Function |
Return Value |
: Nth-child (EQ | even | odd | index) |
ObtainSpecific position element under each parent Element, Index number starts from 1 |
Element Set |
: First-child |
ObtainThe first child under each parent ElementElement |
Element Set |
: Last-child |
ObtainThe last child under each parent ElementElement |
Element Set |
: Only-Child |
ObtainEach parent element has only one child.Element |
Element Set |
Example -- use the jquery sub-element filter selector to select an element
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XMTML 1.0 2 Transitional//EN" 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 4 Demo
Filter selector-child element filter Selector