var html = \'sup\'
sup
I want to run document.querySelectorAll(\'p\') on that text without inserting it into the dom.>
document.querySelectorAll(\'p\')
With IE 10 and above, you can use the DOM Parser object to parse DOM directly from HTML.
var parser = new DOMParser(); var doc = parser.parseFromString(html, "text/html"); var paragraphs = doc.querySelectorAll('p');