This is what I wanna do:
I have like 30 buttons. And I want that when click each button, it will play different mp3 file. Like this http://www.soundjig.com/pages/soundfx/beeps.html
I just know how to click 1 button to play 1 audio file like this:
<audio id="mysoundclip" preload="auto">
<source src="ci1.mp3"></source>
</audio>
<button type="button" class="ci">play</button>
<script type="text/javascript">
var audio = $("#mysoundclip")[0];
console.log(audio);
$("button.play").click(function() {
audio.play();
});
</script>
I don't wanna apply all this code to all of the buttons - Is there anyway to do this quickly?
Thank you for reading!