I'm not sure how to format a function that I can call with Onclick in the HTML.
I've tried using several methods posted here on StackOverflow and W3 Schools. The sounds are stored locally in the main file, however, I've been trying to use a web file as well. (http://www.intriguing.com/mp/_sounds/hg/dead.wav).
<div id="play">
<button type= button onclick = "play" >Fire!</button>
</div>
<audio >
<source src="Photon.mp3" type="audio/mpeg">
<source src="Photon.mp3" type="audio/ogg">
</audio>
//Optional sound source
function play(){
var audio = document.getElementById("audio");
audio.play();
}
I want the user to hear some type of sound when they click on the Fire button. Thank You