JS Traversal sub-node PIP element

Source: Internet
Author: User

Js node Pip element attribute method//Delete all child nodes before adding subnodes var Usernameele = document.getElementById ("username");      var childs = Usernameele.childnodes;        for (var i = childs.length-1; I >= 0; i--) {usernameele.removechild (childs[i]);  } var username = document.createTextNode (obj.username); Usernameele.appendchild (username); Property: NextSibling Returns the next sibling node of the current node (read-only) previoussibling returns the previous sibling node of this node (read-only) ParentNode returns the parent node (read-only) ChildNodes a list of child nodes of the storage node (read-only ) NodeValue returns the text of the node (read/write) text returns the textual content of this node and its descendants (readable) NodeName returns the name of the node (read-only) Attributes a list of properties for the storage node (read-only) DataType return The data type definition for this node is defined in the DTD or XML Schema (read-only) Doctype the specified document type node (read-only) documentelement returns the root element of the document (readable and writable) FirstChild returns the current section The first child node of a point (read-only) implementation returns the Xmldomimplementation object LastChild returns the last child node of the current node (read-only) NodeType the type of the returned node (read-only) Nodetypedval UE Storage node Value (read-write) ownerdocument returns the root document containing this node (read-only) parsed returns whether this node and its child nodes have been parsed (read-only) Prefix returns the namespace prefix (read-only) Preservewhitespac e Specifies whether to leave a blank (read-write) URL returns the URL (read-only) XML return section of the most recently loaded XML documentXML representations of points and their descendants (read-only) method: getElementsByTagName Returns the collection of elements for the specified name AppendChild adds a new child node to the current node, and puts the last child node createelement create an element node CR Eatetextnode creates a text node that includes the given data removechild removes the specified child node from the child nodes list HasChildNodes returns the current node has child nodes CloneNode returns a copy of the current node createat Tribute Create a new property Createcdatasection Create a CDATA segment that includes the given data createcomment create a comment node Createdocumentfragment create Documentfra Gment object Createentityreference Creating EntityReference object CreateNode Creating a node of the given type, name and namespace createporcessinginstruction create an action instruction Node InsertBefore inserting a child node before the specified node load import an XML document at the specified location loadxml import the XML document for the specified string replacechild replace the specified child node from the child node list save the XML To the specified node selectnodes the specified match to the node and returns a list of matching nodes selectSingleNode a specified match to the node and returns the first matching node transformnode the node and its descendants using the specified style sheet transformNodeToObject Converting a node and its descendants to an object using the specified style sheet

JS Traversal sub-node PIP element

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.