SoFunction
Updated on 2025-04-13

Javascript & DHTML DOM Basics and Basic API Page 4/5


2) Attribute:, Return value: HTML value within a node. This property is a writable property. Although it is not a fetch node, it is often combined with fetch nodes, so I put it in the fetch node category, and its properties are similar to data in the pure text node attributes. Taking these two APIs as an example, we can simplify the code written above, as shown below:

[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]

3) Method: (the name of the tag), returns a collection, and all elements in the set have elements with specified tags. To access elements in the collection, you can use the subscript to access them. The object in the syntax refers to document (root) or an ELEMENT_NODE. I won’t write this principle example, it can be used as an assignment, everyone can write it. Here are some specific applications. As in the above example, we can also write this way.

[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]

Take another example, note that the node depth under BODY is 2.

[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]

Previous page12345Next pageRead the full text