我有困難停止我的MP3一旦打。JavaScript的JS停止音樂按鈕 - MP3
//html code
<button onclick="musicHint()">Start music</button>
<button onclick="musicStop()">Stop music</button>
//js code
//music starts
function musicHint(){
console.log("music start button working!");
new Audio('snoop.mp3').play();
}
//music stop
function musicStop(){
console.log("music start button problems");
new Audio('snoop.mp3').pause();
}
line - newAudio('snoop.mp3')。pause();沒有暫停MP3
什麼想法?感謝
非常感謝你之前!我得到了它的工作 –