1<!-- There are several ways but if you are a begginer this is quite simpler-->
2
3<!--In Your JavaScript Code-->
4<script>589{
10 document.getElementById('musicPlayer').setAttribute('src', Arr[x])
11 }
12</script>
13
14<!-- In Your Html Code -->
15<!-- Create a music element -->
16<audio controls id="musicPlayer" autoplay>
17<source src="" type="audio/mp3"> <!--Make sure not to put anything in the scr-->
18</audio>
19
20<!-- Create a few buttons -->
21<button onclick="func(0)">Song 1</button>
22<button onclick="func(1)">Song 2</button>
23<button onclick="func(2)">Song 3</button>
24
25<!-- I hope this was helpful! -->