html代码里面调整button按钮的位置
<body><audiosrc="./jieshuo.m4a"controlspreloadid="music"hidden></audio><buttonid="a"o...
<body>
<audio src="./jieshuo.m4a" controls preload id="music" hidden>
</audio>
<button id="a" onclick="a();">播放/暂停</button>
<script>
function a(){
var audio = document.getElementById('music');
if(audio.paused){
audio.play();//audio.play();// 播放
}
else{
audio.pause();// 暂停
}
}
</script>
</body> 展开
<audio src="./jieshuo.m4a" controls preload id="music" hidden>
</audio>
<button id="a" onclick="a();">播放/暂停</button>
<script>
function a(){
var audio = document.getElementById('music');
if(audio.paused){
audio.play();//audio.play();// 播放
}
else{
audio.pause();// 暂停
}
}
</script>
</body> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询