页面中插入背景音乐开启和关闭
<div id="top"><img id="g" onclick="swap_music()" src="图片.jpg" alt="" width="40px" height="40px" /></div>
插入图片
<!--<audio loop="loop" hidden="hidden" autoplay=" autoplay" controls="controls" id="m">
<source src="../*.mp3" type="audio/mpeg" />
</audio>-->
插入音乐
js:
function swap_music()
{ var m = document.getElementById("m")
if(m.paused)
{ m.play() } else { m.pause();
}
}