JavaScript BOM (one);

Source: Internet
Author: User

One: BOM node:

The node is divided into: element node (label) text node (textbox) attribute node (CSS);

Node Relationship: Parent node pips node sibling nodes; O contains b o is the parent node of B, O and B are under the body, two non-contained, O B is a sibling node;

Node Operation:

1.createElement ("O");   O for the label, create an O tag in body 0; How to use var Newop = document.createelement ("div"); Create a new div tag in the body;

2.o.appendchild (b);   o b is a label; Operation put B in the a tag inside//

Example:

<div id= "BTN1" ></div>

<div id= "BTN2" ></div>

<script>

Before operation: Btn1 and btn2 as sibling nodes

Btn1.appendchild (BTN2);

After operation, BTN1 becomes the parent node of BTN2;

<div id= "BTN1" >

<div id= "BTN2" ></div>

</div>

</script>

3.return false;

return false operation equals break; Meet the condition is to jump out;

JavaScript BOM (one);

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.