Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get DOM node with xpath

function getElementByXpath(path) {
  return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}

// *** use *** 
// getElementByXpath(XpathTargetingDOMNode)
Source by gist.github.com #
 
PREVIOUS NEXT
Tagged: #DOM #node #xpath
ADD COMMENT
Topic
Name
6+5 =