js get node index code example
Example 1: js get node index
Array.from(element.parentNode.children).indexOf(element)
Example 2: Get child node index
Array.from(element.parentNode.children).indexOf(element)
Example 3: js get node index
[...element.parentNode.children].indexOf(element);