/ Published in: JavaScript
Is called this way :
`var myNode = getNode(myXPath, targetRootNode);`
`var myNode = getNode(myXPath, targetRootNode);`
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function getNode(xpathStmt, node) { return document.evaluate( xpathStmt, node, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ).singleNodeValue; }