Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>The Document Object</h1>
<h2>The body Property</h2>
<p>Click "Append" to create a p element and append it to the document's body:</p>
<button onclick="myFunction()">Append</button>
<script>
function myFunction() {
  const para = document.createElement("p");
  const node = document.createTextNode("This is a paragraph.");
  para.appendChild(node);
  document.body.appendChild(para);
}
</script>
</body>
</html>