你的位置:首页 > 网页设计

[网页设计]html5 js控制音乐播放


<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<script language="javascript" type="text/javascript">
function autoPlay(){
var myAuto = document.getElementById('myaudio');
myAuto.play();
}
</script>
</head>
<body>
<audio id="myaudio" src="http://www.rrt.dev/pages/qqs.mp3" controls="controls" loop="false" hidden="true" >
</audio>
<input type="button" onclick="autoPlay()" value="播放"/>

</body>
</html>