function getObjectFromClickedEl(clickedElClassName) {
const clickedEl = document.querySelectorAll(clickedElClassName);
for (let i = 0; i < clickedEl.length; i += 1) {
clickedEl[i].addEventListener("click", function (event) {
console.log(event.currentTarget);
});
}
}
No comments:
Post a Comment