UNPKG

vanillajs-browser-helpers

Version:

Collection of convenience code snippets (helpers) that aims to make it a little easier to work with vanilla JS in the browser

14 lines (13 loc) 258 B
/** * Find the index of a DOM element amongst its siblings * * @param elm - DOM element to find the index of * @return The index of `elm` * * @example * * ```ts * elmIndex(someDiv); * ``` */ export default function elmIndex(elm: Element): number;