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