element-index

1.0.1 • Public • Published

Element index

HTMLElement DOM tree position as a proto function.

Installation

npm i element-index --save

Implementation

HTML

<ul>
	<li></li>
	<li></li>
	<li class="is-active"></li>
</ul>

JS

import 'element-index';

document.querySelector('.is-active').index(); // returns 2

Package Sidebar

Install

npm i element-index

Weekly Downloads

5

Version

1.0.1

License

MIT

Unpacked Size

1.93 kB

Total Files

4

Last publish

Collaborators

  • gnu