【正文】
t node of the document)parentNodeReturns the parent node of a nodepreviousSiblingReturns the node immediately preceding a node. Two nodes are siblings if they have the same parent nodetagNameReturns the name of the element nodeMethodsMethodDescriptionappendChild(tagname)Appends a new child node to a nodecloneNode(boolean)Creates an exact clone node of a node. If the boolean parameter is set to true, the cloned node clones all the child nodes of the original node as wellgetAttribute(attrname)Returns the value of the specified attributegetAttributeNode(attrname)Returns the specified attribute node as an Attr objectgetElementsByTagName(tagname)Returns the specified node, and all its child nodes, as a node listhasChildNodes()Returns true if a node has child nodes. Otherwise it returns falseinsertBefore(newnode,refnode)Inserts a new node (newnode) before the existing node (refnode)normalize()Combines all subtree Text nodes into a single oneremoveAttribute(attrname)Removes the specified attribute39。s properties and methods are described below:PropertiesPropertyDescriptionattributesReturns a NamedNodeMap that contains all attributes of a nodechildNodesReturns a node list that contains all children of a nodedataReturns the data of the nodefirstChildReturns the first child node of a nodelastChildReturns the last child node of a nodelengthReturns the length of the data (in characters)nextSiblingReturns the node immediately following a node. Two nodes are siblings if they have the same parent nodenodeNameReturns the name of the node (depending on the node type)nodeTypeReturns the node type as a numbernodeValueReturns the value of the nodeownerDocumentReturns the Document object of a node (returns the root node of the document)parentNodeReturns the parent node of a nodepreviousSiblingReturns the node immediately preceding a node. Two nodes are siblings if they have the same parent nodeMethodsMethodDescriptionappendChild(tagname)Appends a new child node to a nodeappendData(strdata)Appends the specified string to the existing datacloneNode(boolean)Creates an exact clone node of a node. If the boolean parameter is set to true, the cloned node clones all the child nodes of the original node as welldeleteData(offset,count)Removes the specified range of characters from the datahasChildNodes()Returns true if a node has child nodes. Otherwise it returns falseinsertBefore(newnode,refnode)Inserts a new node (newnode) before the existing node (refnode)insertData(offset,string)Inserts the stringdata at the specified offsetremoveChild(nodename)Removes the specified node and returns itreplaceChild(newnode,oldnode)Replaces the oldnode with the newnode, and returns the oldnodereplaceData(offset,count,stringdata)Replaces the characters from the specified offset with the stringdataThe Document objectThe document object is the root element in the nodetree. All nodes in the node tree are child nodes of the document object.The document object39。s properties and methods are described below:PropertiesPropertyDescriptionattributesReturns a NamedNodeMap that contains all attributes of a nodechildNodesReturns a node list that contains all children of a nodefirstChildReturns the first child node of a nodelastChildReturns the last child node of a nodenameReturns the name of the attributenextSiblingReturns the node immediately following a node. Two nodes are siblings if they have the same parent nodenodeNameReturns the name of the node (depending on the node type)nodeTypeReturns the node type as a numbernodeValueReturns the value of the nodeownerDocumentReturns the Document object of a node (returns the root node of the document)parentNodeReturns the parent node of a nodepreviousSiblingReturns the node immediately preceding a node. Two nodes are siblings if they have the same parent nodevalueReturns the value of the attributeMethodsMethodDescriptionappendChild(tagname)Appends a new child node to a nod