Sha256: 926a9a07d99590e9eab031eff3542bb0f517a8dc4a30742f84be48c797175ded
Contents?: true
Size: 609 Bytes
Versions: 35
Compression:
Stored size: 609 Bytes
Contents
import '../vendor/polyfills/Element/prototype/closest.mjs' /** * Returns the value of the given attribute closest to the given element (including itself) * * @param {HTMLElement} $element - The element to start walking the DOM tree up * @param {string} attributeName - The name of the attribute * @returns {string | undefined} Attribute value */ export function closestAttributeValue ($element, attributeName) { var closestElementWithAttribute = $element.closest('[' + attributeName + ']') if (closestElementWithAttribute) { return closestElementWithAttribute.getAttribute(attributeName) } }
Version data entries
35 entries across 35 versions & 1 rubygems