We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91f0274 commit 80049bcCopy full SHA for 80049bc
01 - JavaScript Drum Kit/index-START.html
@@ -59,7 +59,10 @@
59
60
<script>
61
62
+
63
64
function playSound(e){
65
+ console.log(e);
66
const audio = document.querySelector(`audio[data-key="${e.keyCode}"]`);
67
const key = document.querySelector(`.key[data-key="${e.keyCode}"]`);
68
if(!audio) return; //stop the function from running all together
@@ -76,8 +79,8 @@
76
79
77
80
const keys = document.querySelectorAll('.key');
78
81
keys.forEach(key => key.addEventListener('transitionend',removeTransititon));
- window.addEventListener('keydown', playSound);
82
83
+ document.addEventListener('keydown', playSound);
84
</script>
85
86
0 commit comments