Return to Snippet

Revision: 65559
at December 19, 2013 22:21 by Ginko


Updated Code
function getNode(xpathStmt, node) {
	return document.evaluate( xpathStmt, node, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ).singleNodeValue;
}

Revision: 65558
at December 19, 2013 22:20 by Ginko


Initial Code
Is called this way :

`var myNode = getNode(myXPath, targetRootNode);`

Initial URL

                                

Initial Description
Is called this way :

`var myNode = getNode(myXPath, targetRootNode);`

Initial Title
Easy XPath Single Node Getter

Initial Tags

                                

Initial Language
JavaScript