您必须使用模式的关闭事件,试试这个
$('#myModal').on('hide.bs.modal', function () { //Change #myModal with your modal id
$('audio').each(function(){
this.pause(); // Stop playing
this.currentTime = 0; // Reset time
});
})
Run Code Online (Sandbox Code Playgroud)