AppendChild Method Detailed

Source: Internet
Author: User

Methods: Target.appendchild (Ele);

There are two actions that occur when you execute the method:

1. Remove the element ele from the original parent element

2. Append the element to the new target element, preserving all style information and events for the element 、、。

when an element ele is appended to another element Div, the default is the element is removed from the original element, and the element's style information, event bindings, and so on, are preserved.

Examples are as follows:

Appending the div11 to the following Div area will also append its style information. when you are at a appendchild , the element is removed from the original div .

The div11 style information is preserved, and if the event is bound above div11 , the div11 is appended to the following Div , its events are still valid

AppendChild Method Detailed

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.