As it mentioned in this post: Why should I not upload images of code/data/errors?
, you should not upload image of your code. You should prefer embed your code with code tag when you ask question on stackoverflow.
In this way, people can answer you more easily.
In your case your using bad javascript function, you should use querySelectorAll in place of querySelector if you want to select all your button that have the drum class.
2
Answers
.querySelector(".drum") selects the first element with class "drum" so the {i} is useless, use querySelectorAll.
As it mentioned in this post: Why should I not upload images of code/data/errors?
, you should not upload image of your code. You should prefer embed your code with code tag when you ask question on stackoverflow.
In this way, people can answer you more easily.
In your case your using bad javascript function, you should use
querySelectorAll
in place ofquerySelector
if you want to select all your button that have thedrum
class.querySelector
select and return the first match of the condition as it said in the documentation: https://developer.mozilla.org/fr/docs/Web/API/Document/querySelector