javascript get index of node code example Example: js get node index [...element.parentNode.children].indexOf(element);