Trying to add a new element to the DOM but I get all sorts of errors depending on what I try to do.
<html>
<head>
<script>
var newElement = document.createElement("pre");
var newText = document.createTextNode("Contents of the element");
newElement.appendChild(newText);
document.getElementsByTag("body").appendChild(newElement);
</script>
</head>
<body>
<p>Welcome</p>
</body>
</html>