Difference between append() and appendChild() in javascript

  • Element.append() accepts both Node objects and strings, whereas Node.appendChild() only accepts Node objects.
  • Element.append() can append several nodes and strings, whereas Node.appendChild() can only append one node.
  • Element.append() has no return value, whereas Node.appendChild() returns the appended Node object.

References

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top