+ 1

How to make play sound(mp3) button in javascript?

Javascript Button Sound

7th Sep 2017, 3:09 PM
Irman Utamara
Irman Utamara - avatar
2 odpowiedzi
0
var audio = new Audio("path/to/audio.mp3"); var btn = document.getElementById("btn"); btn.addEventListener("click", function(){ audio.play()});
21st Sep 2017, 5:40 AM
Tio Misbaqul Irawan
Tio Misbaqul Irawan - avatar