Answers for "play sound with keydown javascript"

0

play sound with keydown javascript

document.addEventListener('keydown', function(e) {
  if (e.keyCode == 65) {
    document.getElementById('audio').play();
  }
});
Posted by: Guest on September-20-2020
0

play sound with keydown javascript

<audio id="audio" controls style="display:none">
  <source src="http://butlerccwebdev.net/support/html5-video/media/soundfile.mp3" type="audio/mpeg"> Your browser does not support the audio element.
</audio>
Posted by: Guest on September-20-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language