We have a special requirement in a project where we have to parse a string of HTML (from an AJAX response) client side via JavaScript only. Thats right
You can leverage the current document without appending any nodes to it.
Try something like this:
function toNode(html) {
var doc = document.createElement('html');
doc.innerHTML = html;
return doc;
}
var node = toNode(' This is the old title. ');
console.log(node);