<h1>Original Title</h1>
<p>Original Paragraph</p>
html, body {
display: grid;
height: 100%;
align-content: center;
justify-items: center;
}
const simpleHTML = '<h1>New Title</h1>'
const body = document.querySelector('body')
const firstChild = body.querySelector(':first-child')
// insert the new element as after the first child
firstChild.insertAdjacentHTML('afterend', simpleHTML)
This Pen doesn't use any external JavaScript resources.