A page element appendchild the problem of appending to another page element _javascript tips

Source: Internet
Author: User

You usually create your own elements and then append to the page, but what if the page itself has elements append to another page element?

looks like :

The element does become a child of another element

And the elements themselves are not.

In other words, disappeared. Rather than copying

This, indeed, is the case, but I think the mechanism is very strange.

Can not be copied, that is, 1 became the child of 2, and then 1 is still there.

This is not to say that demand is generally the case. On the contrary, the need is usually to delete the original, such as the case

But logically, think about it: first Append, then we delete the original 1 elements ourselves.

Now, append also has its own remove function.

Be aware.

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.