jquery Selector--Hierarchy Selector

Source: Internet
Author: User

jquery Hierarchy Selector

1 Full Selector $ ("*")

aka * Selector, select the element in the document page in jquery, wildcard * Set the default margin for all elements

2 in. getElementsByTagName () Pass * can get all elements

3 Compatibility of getElementById

getElementById parameters are not case-sensitive in IE8 and lower versions

IE8 and lower versions, browsers do not support Getelementbyclassname

IE will implement the annotation node as an element, and calling Getelementbytagname in IE will include the comment node

IE7 and lower versions and form elements,getElementById selects the first element

4 level Selector

processes child elements, descendant elements, sibling elements, and neighboring elements in a node

5 The difference between hierarchical selectors

The child selector selects all child direct children specified in the specified "parent" element

Descendant selector selects all descendant elements of the given ancestor element

Adjacent sibling selector selects all next elements immediately following the Prev element

The general sibling selector matches all sibling elements after the Prev element, has the same parent element, and matches the filter siblings selector

6-level selectors have a reference node

7 descendant selector includes selection of sub-selectors

8 General Sibling Selector contains the contents of the adjacent sibling selection

9 adjacent sibling selectors and general sibling selectors the element that is selected must be in the same parent element

jquery Selector--Hierarchy 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.