我需要在按钮点击时播放几个wav文件.我发现解决方案在IE中工作,但它需要Firefox的QickTime插件.
还有其他方法吗?
<html>
<head>
<script>
function DHTMLSound(surl) {
document.getElementById("dummyspan").innerHTML=
"<embed src='"+surl+"' hidden=true autostart=true loop=false>";
}
</script>
</head>
<body>
<h1>test</h1>
<span id=dummyspan></span>
<input type="button" value="Play" onmouseover="DHTMLSound('1.wav')">
</body>
</html>
Run Code Online (Sandbox Code Playgroud)