DocumentFragment
and compares its speed with the usual appendChild
. My comments further in italics.DocumentFragment
is a lightweight container for DOM nodes. It is part of the DOM 1 specification and is supported in all modern browsers (it was added to Internet Explorer in version 6).Also, various operations — for example, adding nodes as children of anotherNode
— can takeDocumentFragment
objects as an argument; as a result, all the child nodes of thisDocumentFragment
moved to the list of child nodes of the current node.
Source: https://habr.com/ru/post/31655/
All Articles