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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    4
  • 1.0.0
    1

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