javascript get position number of a child elements code example
Example 1: Get child node index
Array.from(element.parentNode.children).indexOf(element)
Example 2: js get node index
[...element.parentNode.children].indexOf(element);
Array.from(element.parentNode.children).indexOf(element)
[...element.parentNode.children].indexOf(element);