// add a new span element to top of mdn
var new_header = document.createElement("span")
var new_header_content = document.createTextNode("new replacement span element")
new_header.appendChild(new_header_content)
var header = document.getElementById('main-header')
var parentDiv = header.parentNode
parentDiv.replaceChild(new_header, header)
// to remove it
let node = document.getElementById('main-header')
if (node.parentNode) {
node.parentNode.removeChild(node)
}