UNPKG

@web3r/flowerkit

Version:

A collection of more than 60 often used utility JS functions that simplify frontend development.

16 lines 502 B
/** * Gets index of Node from relatively its siblings * @param el{HTMLElement|Node|Element|Document} - DOM element * @return {number} * @example * // How to get index of specific `li` element? * // <ul> * // <li>0<li> * // <li id="myElement">1</li> * // <li>2</li> * // </ul> * const index = document.querySelector("li#myElement"); * console.log(index); // => 1 */ export function getIndexOfEl(el: HTMLElement | Node | Element | Document): number; //# sourceMappingURL=index.d.ts.map