2 ms·
I also thought the writing/parsing makes it a lot slower than DOM createElement methods. Here's also an interesting SO thread: https://stackoverflow.com/questio
by Sjeiti 1y ago
I also thought the writing/parsing makes it a lot slower than DOM createElement methods. Here's also an interesting SO thread: https://stackoverflow.com/questions/802854/why-is-document-write-considered-a-bad-practice https://stackoverflow.com/questions/802854/why-is-document-w...
- Cyykratahk 1y agoI'd always assumed the opposite, seeing as a browser's primary function is to parse HTML text into DOM nodes as efficiently as possible. But on the other hand, since document.write (rightfully) gets such little usage - and has a multitude of footguns - I wouldn't be surprised if browsers used a different, slower code path when executing it; if only to prevent it from borking the parser.