Thử mã sau để thêm nút dừng cho audio HTML5:
function displayStopBtn() { var myPlayer = document.getElementsByTagName('audio')[0]; myPlayer.pause(); myPlayer.currentTime = 0; }Cũng có thể dùng jQuery:
$("#stopButton").click(function () { audio.pause(); audio.currentTime = 0; });