Drum Machine: Can't get audio to play

Hi, I’m working on the drum machine project, but I can’t seem to get the audio to play. I’ve searched the forum, had a look at tutorials, but still can’t figure out where I’m going wrong. Please can anyone help?

Here’s my code so far:

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36.

Challenge: Build a Drum Machine

Link to the challenge:

You’ve attached the onClick event to the audio tag, but that’s not something you can actually click on. Instead you’d have to give it to the outer <div className="drum-pad">.

That solved it. Thanks very much!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.