Easy Tutorial
❮ Dom Met Element Removeattributenode Dom Processinginstruction ❯

XML DOM length Attribute



Definition and Usage

The length attribute returns the number of characters in the selected nodes.

Syntax


Example

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

Example

The above code will output:

Remember, the length above is the length of the entire CDATA section (<b>Stunning!</b>), not just the text length.


❮ Dom Met Element Removeattributenode Dom Processinginstruction ❯