HTMLElement DOM tree position as a proto function.
npm i element-index --save
<ul>
<li></li>
<li></li>
<li class="is-active"></li>
</ul>
import 'element-index';
document.querySelector('.is-active').index(); // returns 2
HTMLElement DOM tree position as a proto function
HTMLElement DOM tree position as a proto function.
npm i element-index --save
<ul>
<li></li>
<li></li>
<li class="is-active"></li>
</ul>
import 'element-index';
document.querySelector('.is-active').index(); // returns 2
HTMLElement DOM tree position as a proto function
MIT License