Common CSS selector syntax of the dojo. Query () method

Source: Internet
Author: User

Common CSS selector syntax of the dojo. Query () method

Syntax Meaning {http://didi.cnblogs.com} Example
* Any element Dojo. Query ("*")
E Elements labeled as E Dojo. Query ("Div ")
. C Elements with Class C Dojo. Query (". Baz ")
E. c Elements labeled as E with Class C Dojo. Query ("Div. Baz ")
# ID Element whose ID value is ID Dojo. Query ("# quux ")
E # ID Element with Label E and ID value ID Dojo. Query ("span # quux ")
[A] Element with attribute Dojo. Query ("[Foo]")
E [A] Element with attribute a and Label E Dojo. Query ("span [Foo]")
[A = "v"] Element with a property A and its value is V Dojo. Query ("[Foo = 'bar']")
E [~ = 'V'] The label is E and has attribute a, and the attribute value is a list separated by spaces. At the same time, an element whose value is exactly equal to V Dojo. Query ("span [Foo ~ = 'Bar'] ")
E [A ^ = 'V'] Element whose label is E and has attribute a and whose attribute value starts with V Dojo. Query ("span [Foo ^ = 'bar']")
E [A $ = 'V'] Element whose label is E and has attribute a and whose attribute value ends with V Dojo. Query ("span [Foo $ = 'bar']")
E [A * = 'V'] The label is E with attribute a, and the attribute value contains the element of the sub-string v. Dojo. Query ("span [Foo * = 'bar']")
E> F F element as Element E sub-element Dojo. Query ("div> span ")
E F F element as the descendant element of Element E Dojo. Query ("e f ")

I sorted it out. It should be helpful for some beginners.

Related Article

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.