EvoToolkit - v2.3.0 (Changelog)

getParent

This helper function cycles up the DOM tree and returns the first parent element matching the given class name.

Source

Contributors

Luke Harrison

Usage

import getParent from './../../../node_modules/evotoolkit/src/js/tools/getParent.js'; const myElem = document.querySelector('.js-my-elem'); const myElemsParent = getParent(myElem, 'c-input');