<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style>
#play{ width:200px; height:30px; text-align:center; line-height:30px; background-color:#CCCCCC; float:left;}
</style>
<script>
function playmp3(){
var player="<embed src=1.mp3 width=200 height=30 loop=-1>";
//“1.mp3”路径,自己改。loop=-1 循环播放。
document.getElementById("play").innerHTML=player;
}
</script>
</head>
<body>
<div id="play" onmouseover="this.style.cursor='pointer';" onclick="playmp3();">点击播放</div>
</body>
</html>
本回答被提问者和网友采纳