In my web application I would like to complately avoid html and use only javascript to create web-page\'s dom tree.
What is faster writing web content in the traditi
I find it interesting that you would consider creating a document purely through Javascript. It's actually faster to create elements using the DOM and document.createElement
than .innerHTML
property. This method creates the document objects directly, whereas using innerHTML
requires the parser to iterate over the HTML and create the elements.
On the other hand, using Javascript instead of writing the HTML directly would require the Javascript to be parsed and executed, creating additional overhead over the HTML parser.