Binding A Sound to a click Event

Hi @tallen261, there are a couple if issues…

  • The source of the audio element must point to the URI of an actual sound file, not to a page where you can download it.
  • You forgot to precede the ID of the audio element with a #, like
var boo = $("#wronganswer")[0];
  • The play() method is written lower case and (AFAIK) doesn’t expect any arguments.

BTW, you could also just use the JS audio interface, like

var boo = new Audio('source/to.mp3');
boo.play();

which is maybe a bit cleaner, since you’re only accessing it with JS anyway.