diff --git a/noise.js b/noise.js index 1d6dd4b..cbc0495 100644 --- a/noise.js +++ b/noise.js @@ -1,3 +1,14 @@ $(document).ready( function() { - // your code here + + $('.note').click( function(){ + const note = $( this ).attr("class").split(" ")[1]; + $(`#${note}Audio`)[0].load(); + $(`#${note}Audio`)[0].play(); + }); + + $('body').keydown( function(event){ + $(`#${event.key}Audio`)[0].load(); + $(`#${event.key}Audio`)[0].play(); + }); + });