JavaScript BOM (both);

Source: Internet
Author: User

Parent-node Pips-Sibling-node operation:

1:childnoeds;       Parent node. childNodes; Gets the child element through the parent element (element node, text node, attribute node) and can be modified by the obtained content;

2:children;             Parent node. Children; Gets the element node (label node) of the child element through the parent node;

3:firsechild; Parent node. firsechild= Children[0] gets to the first child node through the parent node;

4:lastchild; The parent node. LastChild gets to the last child node through the parent element;

5:parentnode child nodes. ParentNode Gets the parent node through the child node;

6:previoussibling the current node. PreviousSibling find the sibling tag above through the current tab;

7:nextsibling the current node. nextSibling find the sibling tag below through the current node;

BOM (i);

8:a.appendchild (b)//put B at the end of the A-label;

9:createelement ()//Create a new node; var newq = document.createelement ("Li");

Focus:

1. Parent node. insertbefore (new node, inserted position)

JavaScript BOM (both);

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.