Web APIs — Document. createDocumentFragment() | Range.createContextualFragment()
The Document.craeteDocumentFragment() API creates a new empty document fragment (DocumentFragment) object. The document fragment is a lightweight container for creating HTML elements, an alternative to directly inserting elements into the DOM.
Published in
2 min readAug 16, 2022
Instead of appending the elements directly to the document when they are created, append them…