I want to have different beep in my site but its doesnt work
<body>
<!-- html work-->
<audio id="beep-07" src="../audio/beep-07.wav" autostart="false"></audio>
<audio id="button-3" src="../audio/button-3.wav" autostart="false"></audio>
<button onclick="playsound('beep-07')">beep-07</button>
<button onclick="playsound('button-3')">button-3</button>
<!-- js work-->
<script>
function playsound(name) {
var sound = document.getElementById(name);
sound.play();
console.log(sound,name,"1");
}
</script>
</body>
Does anyone know why it doesn't work as expected? By the way, the console log also doesn't have any output!Does anyone know why? update Oh guys i'm so sry!the problem was a simple typo in the code!thanks for your help!i'm so sorry!