<div class='wrapper'>
<div class='dot'></div>
<div class='dot'></div>
<div class='dot'></div>
<div class='dot'></div>
<div class='dot'></div>
<div class='dot'></div>
<div class='dot'></div>
</div>
var dots = document.getElementsByClassName('dots');
Получил массив с dot.let wrapper = document.querySelector('.wrapper')
wrapper.addEventListener('click', function(evt) {
let index = [...this.children].findIndex(el => el == evt.target)
console.log(index)
})
https://jsfiddle.net/Lm21js09/