MCPcopy Create free account
hub / github.com/bermi/element-xpath / getElementByXPath

Function getElementByXPath

test.js:5–8  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

3 var
4 is_commons_js = typeof module !== "undefined" && module.exports,
5 getElementByXPath = function (path) {
6 result = document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
7 return result.singleNodeValue;
8 },
9 expect = is_commons_js ? require('expect.js') : root.expect,
10 getElementXpath = is_commons_js ? require('./element-xpath.js') : root.getElementXpath;
11

Callers 1

test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected