Edit in JSFiddle

var container = document.getElementById('container'),
    paragraph = document.createElement('p'),
    textNode = document.createTextNode('Hello World!');

paragraph.appendChild(textNode);
container.appendChild(paragraph);
<div id="container"><div>