& lttitle & gt運動員& ltstyle & gt& lt/style & gt;& lt/head & gt;& ltbody & gt& ltaudio i" />
& lthtml & gt
& lthead & gt
& ltmeta charset="utf-8 " >
& lttitle & gt運動員
& ltstyle & gt
& lt/style & gt;
& lt/head & gt;
& ltbody & gt
& ltaudio id = " music 01 " src = " g . e . m .鄧紫棋-紅玫瑰和白玫瑰. mp3" loop = "loop " >您的瀏覽器不支持音頻標簽。& lt/audio & gt;
& lta href = " JavaScript:play pause();"& gt& ltimg src = " 1 . jpg " width = " 50 " height = " 50 " id = " music _ BTN 01 " border = " 0 " >& lt/a & gt;
& lt/body & gt;
& lt腳本& gt
函數playPause() {
var music = document . getelementbyid(' music 01 ');
var music _ BTN = document . getelementbyid(' music _ BTN 01 ');
如果(音樂.暫停){
music . play();
music _ BTN . src = ' 1 . jpg ';//播放圖片
}
否則{
music . pause();
music _ BTN . src = ' 1 . jpg ';//暫停圖片
}
}
& lt/script & gt;
& lt/html & gt;