I am trying to get a countdown to work and at the end of the countdown, a sound play. The coount down will start when a button is clicked. Below is my code, any help would be much appreciated!


Here is the Javascript:

function destroyMe(event){

(function(){
var counter = 10;

setInterval(function() {
counter--;
if (counter >= 0) {
span = document.getElementById("count");
span.innerHTML = counter;
}
// Display 'counter' wherever you want to display it.
if (counter === 0) {
alert('Count Down Is Complete');
clearInterval(counter);
var snd=new Audio(event);
snd.play();
}


});
});

}


here is the html:

<div id="wrapper">
<button onClick="destroyMe('meat-tornado.mp3')">Destroy Me</button> <br />

<span id="count">
</span>

</div>



Thanks!