Array.from(element.parentNode.children).indexOf(element)
[...element.parentNode.children].indexOf(element);