guys! I want to know, what's difference between
var newDiv = createElement("div");
someElement.innerHTML(newDiv);
and
var newDiv = "<div></div>";
someElement.innerHTML(newDiv);
What kind of profit will I get? If i want to add big piece of code, i have to create all elements and wrap them one another?
In case, when i have many nest-levels
<div>
<article class="article">
<header class="article-top">
<h1 class="article__title">%title%</h1>
</header>
<div class="article-body">
<p>
%body%
</p>
</div>
</article>
</div>
I see it in other frameworks, as react and etc.
I guess, that i'm wrong, but i need help :)