I've already asked a question very similar to this but I can't get the suggested code to work. the jquery is:
jQuery("span").click(function (event) {
var elementID = event.target.id;
var oggVar = ("audio/"+elementID +".ogg");
var audioElement = document.createElement("audio");
audioElement.setAttribute("src", oggVar);
audioElement.play();
});
This works OK, the problem is it works even tho another audio file is playing. I want to prevent this, so that an audio file does not run if another audio file is playing. Sorry to have to revisit this.