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.

Albin Issac
Tech Learnings
Published in
2 min readAug 16, 2022

--

Instead of appending the elements directly to the document when they are created, append them…

--

--

Albin Issac
Tech Learnings

I work as a Software Architect specializing in Marketing Technologies. For more information, please visit my profile at: https://myprofile.albinsblog.com/