I'm trying to create and insert a div within an already dynamically created div:
var parentDiv = document.createElement('div');
var inner = "stuff";
parentDiv.innerHTML = inner;
someRootDiv.appendChild(parentDiv);
var childDiv = document.createElement('div');
inner = "more stuff";
childDiv.innerHTML = inner;
parentDiv.appendChild(childDiv);
But the child div isn't displayed within the parent div, it's displayed below it as if it's just a following div. Where am I going wrong?