Beta Drum Machine Project

Hello,

I just finished the Beta projects Drum Machine and I was looking for some feedback on my javascript. I managed to make it fairly small without plenty of individual functions or switch or if statements so I am quite proud of that. But I don’t know how quick if there are quicker solutions.

here is the link: Beta Drum Machine

I have used just jquery for this project but one part was problematic. When targeting the children of the div pressed in order to play it, like so:

$(event.target).children('audio.clip')[0].play();

I had a div with a p element and an audio element but even if I was supposed to target only children audio.clip (I tried ‘.clip’ too) it would work very intermittently. I deleted the p element and wrote directly in the div but I wonder if I was targeting the children wrong. Does anybody know? This is the first time I target anything with the children methods so I’m not very familiar with it.

Please let me know your thoughts on the project.

Thank you