write event listener on multiple class element
snippet in javascript

write event listener on multiple class element

user2128

document.querySelectorAll('.some-class').forEach(item => {
  item.addEventListener('click', event => {
    //Write your code hear
  })
})