You could create new document and put responseText
into it. Then you can use querySelectorAll()
. Here is your onreadystatechange
function:
function () {
if (xml.readyState == 4) {
var container = document.implementation.createHTMLDocument().documentElement;
container.innerHTML = xml.responseText;
var nodeList = container.querySelectorAll('selector');
}
}