最佳答案
您的问题已在 MDN Link 中得到解答你发布了。
Differences to Node.appendChild():
- ParentNode.append() allows you to also append DOMString object, whereas Node.appendChild() only accepts Node objects.
- ParentNode.append() has no return value, whereas Node.appendChild() returns the appended Node object.
- ParentNode.append() can append several nodes and strings, whereas Node.appendChild() can only append one node.
关于javascript - 如果已有 Node.appendChild(),ParentNode.append() 有什么用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46955936/