Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

XML DOM - Comment object


May 27, 2021 XML DOM


Table of contents


XML DOM - Comment object

This section describes the XML DOM -Comment object.


XML DOM - Comment object

Try it - instance

The following example uses the XML file .xml.
External JavaScript is used to load XML files.

CreateComment() - Create a comment node


The Comment object

The Comment object represents the contents of the comment node in the document.

The Comment object property

属性 描述
data 设置或返回此节点的文本。
length 返回此节点的文本的长度。

The Comment object method

方法 描述
appendData() 向节点追加数据。
deleteData() 从节点删除数据。
insertData() 向节点中插入数据。
replaceData() 替换节点中的数据。
substringData() 从节点中提取数据。