document.querySelectorAll('button.action').forEach(el => {
el.addEventListener('click', handler)
})
document.addEventListener('click', evt => {
if (evt.target.matches('button.action, button.action *')) {
console.log('target', evt.target)
let button = evt.target.closest('button')
console.log('button', button)
}
})
document.addEventListener('click', async function (event) {
if (!event.target.matches('button.action, button.action *')) {
return;
}
})