Play a sound on onkeydown (Javascript)

I want to play a keystroke wav/mp3 whenever an onkeydown event is registered, in JavaScript.

What's the approved code?
LVL 1
edhastedAsked:
Who is Participating?
 
Gurvinder Pal SinghConnect With a Mentor Commented:
try this one (it says that its cross browser one)
http://stackoverflow.com/questions/187098/cross-platform-cross-browser-way-to-play-sound-from-javascript

just call this method at onkeydown
window.onkeydown = function(){
  //soundPlay("soundurl");
}
0
 
edhastedAuthor Commented:
Thanks, I'll need to spend some time on these and get to grips with the current prower limitations.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.