How to hang a handler on multiple elements?

Hello!

I believe that this is not the most difficult question, but I'm already long on this task. How to hang an event handler on each button?

Code:
https://jsfiddle.net/qc6fhzLg/
June 5th 19 at 21:15
3 answers
June 5th 19 at 21:17
Solution
Delegation. Type so.
June 5th 19 at 21:19
Solution
June 5th 19 at 21:21
Solution
https://jsfiddle.net/mdsmmy3L/2/

A remade version of the friend higher up on ES6
Stylish, fashionable. youth! (ES6). Without prototype and call and short
let buttons = document.querySelectorAll('.btn');


buttons.forEach((elem)=>{
elem.addEventListener('click',()=>{
elem.parentNode.querySelector('.picture').classList.toggle('active')
})
})

Find more questions by tags JavaScript