Home > Web Front-end > JS Tutorial > The problem of appendchild appending a page element to another page element_javascript skills

The problem of appendchild appending a page element to another page element_javascript skills

WBOY
Release: 2016-05-16 17:42:46
Original
1044 people have browsed it

Generally, you create elements yourself and then append them to the page. But what if the elements on the page itself are appended to another page element?

looks like :

The element does become a child of another element

The element itself is gone.

In other words, disappeared. Instead of copying

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

Can't it be a copy, that is, 1 becomes a child element of 2, and then 1 is still there.

It’s not that the demand is generally like this. On the contrary, the demand is generally to delete the original one, such as this case

But logically think about it: first append, and then delete the original 1 element ourselves

Good thing now, append also has its own remove function.

Be careful.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template