var tag = document.createElement("p"); var text = document.createTextNode("This is my text"); tag.appendChild(text);