play drums with your keyboard.
- use of data attributes for storing extra information that doesn't have any visual representation.
<audio>
tag is used to embed sound in document.
- we used
.addEventListener()
method on window, and key elements to listen to events. - we got familiar with
keydown
andtransitionend
events. - we saw that we can use
target.classList.add()
to add a class to a target element. there are alsoremove()
andtoggle()
methods. - we used
audio.play()
to play an audio, we also usedaudio.currentTime(0)
on the audio element to rewind the audio to the beginning.