With ES6 destructuring you can do
const index = [...el.parentElement.children].indexOf(el)
or
const index = Array.from(el.parentElement.children).indexOf(el)
or ES5 version
var index = Array.prototype.slice.call(el.parentElement.children).indexOf(el)