<html>
<body>
<p>Click the button to create a P element with some text.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
var para = document.createElement("P");
para.innerText = "This is a paragraph.";
document.body.appendChild(para);
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_document_createelement3 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:01:40 GMT -->
</html>