jquery lookup Node (selector)

Source: Internet
Author: User
Tags tag name

jquery accomplishes node lookups through selectors:

1. Basic selector:

① Universal/All selectors: $ ("*")//use * to indicate.

②: Tag Selector: $ ("tag name (DIV)")//Use tag name to locate

③:id selector: $ ("#id")

④: Class selector: $ (". Class")

⑤: Group Selector (SET): $ ("TABLE,TD")//all table and TD are selected

⑥: Combo Selector (intersection): $ ("p.c1")//tag p and his class attribute is C1.

2. Hierarchy selector:

①: Descendant selector (space): $ ("div span")//all span tags under div (descendants ... Descendants) are selected.

$ ("div *")//div all tags

②: Descendant selector: $ ("Div>span")//tag span for Div tag's son (only for descendants, not after grandchildren)

$ ("div>") all descendants of the//div tag can be selected

3. Brother Selector:

①:$ ("div+")//Next brother (select only the next sibling tag of the DIV tag)

$ ("Div+div")//Select div tag next brother tag for Div.

②:$ ("div~") all brother tags after//div tag

$ ("div~p")//div tag after all brother tags are selected for p.

JQuery Lookup Node (selector)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.