govuk-frontend
Version:
GOV.UK Frontend contains the code you need to start building a user interface for government platforms and services.
8 lines (6 loc) • 332 B
JavaScript
function closestAttributeValue($element, attributeName) {
const $closestElementWithAttribute = $element.closest(`[${attributeName}]`);
return $closestElementWithAttribute ? $closestElementWithAttribute.getAttribute(attributeName) : null;
}
export { closestAttributeValue };
//# sourceMappingURL=closest-attribute-value.mjs.map