Analysis of Some Important attributes of document objects in javascript-javascript tutorial

Source: Internet
Author: User
This article mainly introduces some important attributes of document objects in JS. If you need them, please refer to them, we hope this will help you to access every element on the page and their attributes through these attributes. Each label can access their attributes through their corresponding arrays.

I. forms array object: a set of All form labels in the Code webpage

2. anchors array object: Specifies the set of all labels with the name or id attribute specified in the webpage, but does not include the set with the href tag specified.

3. The links array object refers to the set of all labels with the href attribute specified.

Iv. images array object: Specifies the set of all tags in the document

5. scripts array object: represents the set of all the script tags in the document.

6. applets array object: represents the set of all tags in the document

7. all array objects: all tags in all documents

8: styleSheets array object: a set of all imported style sheets in the document

9. body object: indicates the HTML sub-elements in the tag pair in the document, which can be referenced as attributes of the body object.

10. title object: indicatesTag pair, used to set and reference content on the tab bar of the webpage </P>

Their reference examples:
Document. all. imag1.src
Document. images. imag1.src
Document. images. item ("imag1"). src
Document. images. item (0). src

You can use the same method to access other elements. Of course, you must specify the name or ID attribute for the object to be accessed, as long as you remember these object arrays, you can use their names to access their corresponding child elements, so you only need to remember the meaning of the above ten elements to easily access and set every element in the webpage document...

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.