how to get child index in js code example Example: Get child node index Array.from(element.parentNode.children).indexOf(element)