<p id="phoneBtn" class="musicBtn" onclick="playMusic('music1')">播放</p> <audio src="音频地址" controls="controls" preload id="music1" hidden></audio>
function playMusic(id){ var audio = document.getElementById(id); if(audio.paused){ audio.play();// 播放 $('.musicBtn').html('暂停') } else{ audio.pause() $('.musicBtn').html('播放') } }