I have this array of strings var arr = ["ul", "li", "strong", "em", "u"].
How can I make these into DOM Elements one inside another from left to right, first element as the root element. Without using ID because of some reason.
And maybe by using loop for it to be flexible to any number of elements.
var new_element = document.createElement(arr[0]);
I'm expecting something like this:
<ul>
<li><strong><em><u>Text Here</u></em></strong></li>
</ul>
Thank you.
Node.appendChild.