Document Object Methods

Many of the methods found in the document object have also been used in previous exercises. There are others available that haven't been used yet, and the complete list is given in Table 18.4.

Table 18.4. The Methods of the Document Object
MethodPurpose
abort()Cancelsa download in progress.
appendChild(newChild)Adds a node to the end of the current list of nodes.
cloneNode(boolvalue)Creates a duplicate of the given node. The clone will be shallow or deep depending on the value of the input.
createAttribute(name)Createsan attribute with the given name.
createCDATASection(name)Creates a CDATA section containing the input.
createComment(name)Creates a comment node containing name.
createDocumentFragment()Creates an empty document ...

Get Sams Teach Yourself XML in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.