const dom = parse(res) return dom.querySelectorAll('input').find(i => i. rawAttributes.name === 'fkey').rawAttributes.value.
Se hela listan på tomassetti.me
The DOMParser can also be used to parse an SVG document (Firefox 10.0 / Thunderbird 10.0 / SeaMonkey 2.7) or an HTML document (Firefox 12.0 / Thunderbird 12.0 / SeaMonkey 2.9). There are three different results possible, selected by the MIME type given. If the MIME type is text/xml, the result will be an XMLDocument. 2020-07-07 parser = new DOMParser(); xmlDoc = parser.parseFromString(text,"text/xml"); document.getElementById("demo").innerHTML = xmlDoc.getElementsByTagName("title")[0].childNodes[0].nodeValue;