Answers for "xpath by name"

1

xpath text

//tag[text()='sometext']
Posted by: Guest on September-29-2020
0

get element by xpath

function getElementByXpath(path) {
  return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}
Posted by: Guest on March-25-2021

Browse Popular Code Answers by Language