Read "JavaScript DOM Programming Art (2nd edition)" NOTE 3

Source: Internet
Author: User

1. A document is a tree of nodes

2. Nodes are divided into different types: element nodes, text nodes, attribute nodes, etc.

3. Each node is an object, and the atom of the DOM is an element node

4.getElementById returns an object that corresponds to a specific element node in the document

5.getELementsByTagName and Getelementsbyclassname return an array of objects that correspond to a specific set of ELEMENT nodes in the document, respectively.

The 6.typeof operator can tell us whether its operand is a string, a numeric value, a function, a Boolean, or an object

7. The wildcard ("*") asterisk character must be enclosed in quotation marks, in order to make the wildcard character different from the multiplication operator, if you want to know how many element nodes are in a document: Alert (document.getElementsByTagName ("*"). Length)

8.getElementsByClassName reference this article

9.null and ' difference reference this article

10.setAttribute changes are not reflected in the source code of the document itself, this "duplicity" phenomenon stems from the DOM working mode: Loading the static content of the document, and then dynamic refresh, dynamic refresh does not affect the static content of the document. This is the true power of the DOM: refreshing the content of the page without having to refresh the page in the browser.

Read "JavaScript DOM Programming Art (2nd edition)" NOTE 3

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.