differences between append and appendChild
Ok, the jQuery variant is more reliable. It also takes several arguments like htmlString, a jQuery collection or element arrays, or even a callback function. And it automatically clones elements if they need to be inserted into multiple parents. the native method accepts only individual nodes (or individual DocumentFragments).
they seem to return different values
Yes. .append() returns the jQuery contextual collection (to which it is added), and .appendChild returns the added element.
This is apparently a problem in your code, a naive conversion will result in a different li value. If you need to bring the child back (there are simpler solutions), you can take a look at the .appendTo method.
and change the elm / $ elm object differently
No, they do not. Both place the added items at the end of the parent collection of children. You may have problems setting the innerHTML value of the return value that is not as expected (see above).
Bergi source share