I created my markup to insert as a string since it's less code and easier to read than working with the fancy dom stuff.
Then I made it innerHTML of a temporary element just so I could take the one and only child of that element and attach to the body.
var html = '
html += 'Hello div!';
html += '
var tempElement = document.createElement('div');
tempElement.innerHTML = html;