Used to process DOM element attributes of XML documents
Attribute Name Description
ChildNodes returns an array of all child elements of the current element.
FirstChild returns the first sub-element of the current element.
LastChild returns the last child element of the current element.
NextSibling returns the elements that follow the current element.
NodeValue indicates the read/write attribute of the element value.
ParentNode returns the parent node of the element.
Previussibling returns the element adjacent to the current element.
DOM element method used to traverse XML documents
Method Name Description
GetElementById (id) (document) obtains the elements in the document with the specified unique ID property value.
GetElementsByTagName (name) returns the array of the child elements in the current element specified by the calibration name.
HasChildNodes () returns a Boolean value indicating whether the element has child elements.
GetAttribute (name) returns the attribute value of an element. The attribute is specified by name.
W3C DOM attributes and methods used for dynamic content creation
Attribute/method description
Document. createElement (tagName) allows you to create elements specified by tagName. If the div string is used as the method parameter, a div element is generated.
Document. createTextNode (text) create a node that contains static text
<Element>. appendChild (childNode) adds the specified node to the subnode list of the current element (as a new subnode)
<Element>. getAttribute (name)
<Element>. setAttribute (name, value) obtains and sets the value of the name attribute in the element.
<Element>. insertBefore (newNode, targetNode) inserts the node newNode as the child node of the current element before the targetNode element.
<Element>. removeAttribute (name): This method deletes the attribute name from the element.
<Element>. removeChild (childNode): This method deletes the child element childNode from the element.
<Element>. replaceChild (newNode, oldNode) replaces node oldNode with node newNode
<Element>. hasChildnodes () returns a Boolean value indicating whether the element has child elements.