There is no big difference between those functions except the syntax:
$('.target').append('text');
$('text').appendTo('.target');
As said in jQuery docs:
The .append() and .appendTo() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .append(), the selector expression preceding the method is the container into which the content is inserted. With .appendTo(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted into the target container.
So in which case it is better to use the .append(), and which .appendTo()? In which code-samples fit only one of those two functions and the other is not good enough?
The same question applies to:
Like they say, mostly append() and appendTo produce the same results. However, when you start chaining the result, you can see a difference!
Target HTML:
First with append():
Produces:
Second with appendTo()
Produces: