What is the difference between document.createElement and createDocumentFragment?

Usually we can use document.createDocumentFragment () to create a piece of the DOM before adding the piece to the real DOM.

But we could also use document.createElement () to hold the piece.

So what should we use?

+4
source share

All Articles