Easy Tutorial
❮ Prop Element Attributes Dom Prop Node Previoussibling ❯

XML DOM length Property



Definition and Usage

The length property returns the length of the text in a comment node (in characters).

Syntax


Example

The following code snippet uses loadXMLDoc() to load "books_comment.xml" into xmlDoc and retrieves the text node data and length from the first <title> element:

Example

The above code will output:

In the example above, we use a loop and an if statement to perform processing specifically for comment nodes. The node type for comment nodes is 8.


❮ Prop Element Attributes Dom Prop Node Previoussibling ❯