Dom manipulation of JavaScript
ChildNodes returns an array of all child elements of the current element
FirstChild returns the first subordinate child element of the current element
LastChild returns the last child element of the current element
NextSibling returns the element immediately following the current element
NODEVALUE Specifies the read/write property that represents the value of the element
ParentNode returns the parent node of the element
PreviousSibling returns the element immediately preceding the current element
getElementById (ID) (document) Gets the element with the specified unique ID property value in the document
Getelementsbytagname_r (name) returns an array of child elements in the current element with the specified tag name
HasChildNodes () returns a Boolean value indicating whether the element has child elements
GetAttribute (name) returns the attribute value of the element, which is specified by name
The Createelement_x method on the document.createelement_x (tagName) Document object can create an element that is specified by the tagName. If a string div is used as a method parameter, a DIV element is generated
The createTextNode method of the document.createTextNode (text) Document object creates a node that contains static text
The. appendchild (Childnode) AppendChild method adds the specified node to the list of child nodes of the current element (as a new child node). For example, you can add an option element as a child node of a SELECT element
. getattribute (name)
. SetAttribute (name, value) These methods obtain and set the value of the Name property in the element, respectively
. insertbefore (NewNode, TargetNode) This method inserts the node newNode as a child of the current element in front of the TargetNode element
. RemoveAttribute (Name) This method removes the attribute from the element name
. RemoveChild (Childnode) This method removes the child element from the element Childnode
. ReplaceChild (NewNode, OldNode) This method replaces the node OldNode with the node NewNode
. HasChildNodes () This method returns a Boolean value indicating whether the element has child elements
Dom manipulation of JavaScript