Differences between append and appendTo and appendChild usage
Many new users are confused about the differences between append and appendTo and the appendChild usage in js. The following is an example to describe in detail. Do not miss out on interested users.
Append () is the object to be selected, followed by the element content to be inserted in the object
Before appendTo (), the content of the element to be inserted is a Jquery object, followed by the object to be selected.
Instance:
$ ('# A'). append ('content ');
$ ('<Div> content </div>'). appendTo ($ ('# '));
Note that before appendTo, it must be a Jquery object.
AppendChild (Node) is generally used to add a Node after the last subnode of the specified Element Node.
However, if Node is a DOM object on the page, you can directly Move the Node instead of adding nodes.
AppendChild can be understood as moving an element. If you want to copy a copy, clone it in advance.