const html = parseHTML('<a href="#">Example</a>');
const text = html.querySelector('a').innerText;
console.log(text); //> Example
function parseHTML(html) {
var page = document.implementation.createHTMLDocument();
page.body.innerHTML = html;
return page.body;
}