closest
IE11で使えないんですよねーclosest。 なので、 getParent($current, cls) { let $target = $current.parentNode; while ($target.tagName !== 'BODY') { if ($target.classList.contains(cls)) { return $target; } $target = $target.parentNode; } } 「現…
IE11で使えないんですよねーclosest。 なので、 getParent($current, cls) { let $target = $current.parentNode; while ($target.tagName !== 'BODY') { if ($target.classList.contains(cls)) { return $target; } $target = $target.parentNode; } } 「現…