1.2.0 • Published 10 years ago

closest-parent-by-attributes v1.2.0

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

Get closest parent which has specified attributes

This module implemented to get selector of clicked nodes for web analytics configuration automated check

Build Status Coverage Status

<ul class="menu">
    <li class="menu-item">
        <a class="menu-link" title="Click to go" data-interaction-id="12345"> <!-- This node has analytics attributes -->
            <span class="click-target">Click target</span> <!-- This is click target -->
        </a>
    </li>
</ul>
getClosestParentByAttributes(clickTarget, ['class', 'title', 'data-interaction-id']
// returns [class="menu-link"][title="Click to go"][data-interaction-id="12345"] span
1.2.0

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago