I have been working on the Drum Machine project using just jQuery as I have been out of coding for a while and wanted to refresh what I had learnt before.
Everything is working as it should, however I am still failing tests 5 and 6 about playing the audio clip contained in its child audio element when clicked or the key is pressed.
The sounds do play, so I wondering if it is something to do with how I am getting jQuery to access the audio elements?
If anyone could have a look and shed some light on the situation I would be extremely grateful.
Ah yes, I thought it might have been the Audio constructor that was the problem, not sure why I didn’t just use the DOM in the first place.
I have changed the constructor and the key codes and now I am passing all the tests so thank you. I still have an issue with the button backgrounds remaining red when multiple keys are pressed simultaneously which I need to fix but that is less of a priority.
I did not realise which and keyCode are now basically defunct, thank you for pointing me to ‘key’. That was exactly what I was looking for in the first place but I somehow missed it in my search. I shall change it to ‘key’ when I get the chance.