JS-function on array

Hey so, I've got an array and I need a listener on it that'll always be listening
It has to run a function, using the index of the element within the array its been clicked on (As it would have to delete the element including its siblings and its parentElement

However, I cannot put an addEventListener on the raw array it seems, this is what I've got:
let removeSelectors = document.getElementsByClassName("removeSelector")
removeSelectors.addEventListener("click", function(){console.log(removeSelectors)})
// Ive put a console.log bc I first wanted to test if it would work, then I was going to see how to make the function target the element you've clicked on


As a sidenote, this function will have an array of [] in the beginning, as no elements will have that className yet (I figured to use getElementsByClassName as its dynamic and not static and the array can get longer and shorter, if one is deleted obv it'll get shorter if ones added itll get longer)


The error in the console is:
Uncaught TypeError: removeSelectors.addEventListener is not a function
    at bingo.js:40:17
(anonymous) @ bingo.js:40
Was this page helpful?