Full-stack JavaScript (12) Understanding of Selector APIs

Source: Internet
Author: User

Full-stack JavaScript (12) Understanding of Selector APIs

Before 2008, almost all DOM extensions in browsers were proprietary. Since then, W3C has begun to standardize and write some proprietary extensions that have become fact standards.

The core of Selector API level 1 is two methods: querySelector () and querySelectorAll (). It can be called by a Docuemnt node or an Element node in a compatible browser.

Currently, browsers that fully support Selectors API Level 1 include IE 8 +, Firefox 3.5 +, Safari 3.1 +, Chrome and Opera 10 +.


The Selector API level 2 standard adds the matchesSelector () method to the Element type. This method accepts a CSS Selector parameter. If the called Element matches the Selector, true is returned.


For more information, see:

  • Http://www.w3.org/TR/selectors-api/
  • Http://www.w3.org/TR/selectors-api2/

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.