Odoo18-Base/addons/project/static/tests/project_test_utils.js
2025-03-10 10:52:11 +07:00

7 lines
227 B
JavaScript

/** @odoo-module */
export function getFirstElementForXpath(target, xpath) {
const xPathResult = document.evaluate(xpath, target, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
return xPathResult.singleNodeValue;
}