We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84466bb commit f8879acCopy full SHA for f8879ac
01 - JavaScript Drum Kit/index-rose.html
@@ -60,7 +60,11 @@
60
<script>
61
62
window.addEventListener('keydown', function(e){
63
- const audio = document.querySelector(`audio[data-key=]`);
+ const audio = document.querySelector(`audio[data-key="${e.keyCode}"]`);
64
+ const key = document.querySelector(`.key[data-key="${e.keyCode}"]`);
65
+ if (!audio) return;
66
+ audio.play();
67
+ key.classList.add('plyaying');
68
});
69
70
0 commit comments