Can also be done with plain JavaScript:
let = _this = this,
indx = Array.prototype.slice.call(_this.parentElement.childNodes).indexOf(_this);
Or, if you trying to style your ordered html list with other than CSS like
, as @Jan mentioned, use querySelectorAll('li') instead of childNodes.