document.body.addEventListener('click', (event) => {
if (event.target.matches('.buttons')) {
some_function(event)
}
})
for(let i=0; i<buttons.length; i++){
button = buttons[i]
button.addEventListener('click', some_function)
}