Answers for "select multiple selectors for click event lintener html dom"

0

select multiple selectors for click event lintener html dom

[document.querySelector('.a-class'), document.querySelector('.another-class')].forEach(item => {
  item.addEventListener('click', event => {
    //handle click
  })
})
Posted by: Guest on April-02-2021

Browse Popular Code Answers by Language