Full selector for jquery selector (* selector)

Source: Internet
Author: User

In CSS, it is often written in the first line of a style:

{    margin: 0;     padding:0;  }

The wildcard * means that the default margin is set for all elements. In jquery we can also select elements in the document page by passing the * selector.

Describe:

$ (' * ')

Aside from jquery, if you want to get all the elements in the document, passing ' * ' through document.getElementsByTagName () can also be obtained.

It is not difficult to find that Id,class,tag can get to the corresponding node through the native method, but we still have to consider a compatibility problem, and here by the way, for example:

1. IE will implement the annotation node as an element, so calling getElementsByTagName in IE will include a comment node, which is usually not expected.

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

3. IE7 and the lower version, in the form element, if the Name property name of form a uses the ID name of another element B and a before B, then Getelmentbyid will select a.

4. IE8 and the lower version, the browser does not support Getelementsbyclassname.

Full selector for jquery selector (* selector)

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.