<!--声音-->
<audio id="v1" controls="controls" height="100" width="100" style=" display:none">
<source src="music.mp3" type="audio/mp3" />
<source src="song.ogg" type="audio/ogg" />
<embed height="100" width="100" src="music.mp3" />
</audio>
<script>
var myVideo=document.getElementById("v1");
function playVid()
{
myVideo.play();
}
function pauseVid()
{
myVideo.pause();
}
</script>
<button onClick="playVid()">播放</button>
<button onClick="pauseVid()">暂停</button>
参考文档:
HTML5标签介绍:
http://www.w3school.com.cn/tags/html_ref_audio_video_dom.asp
音频播放介绍
http://www.w3school.com.cn/html/html_audio.asp