【发布时间】:2014-08-07 01:41:18
【问题描述】:
我的代码不起作用。我正在使用下面提到的代码,我在此代码中使用的是文本而不是图像。
<html> <head><script type="text/javascript">
function playSound(el,soundfile) {
if (el.mp3) {
if(el.mp3.paused) el.mp3.play();
else el.mp3.pause();
} else {
el.mp3 = new Audio(soundfile);
el.mp3.play();
}
}</script>
</head>
<body>
<a href="javascript: void(0);" onClick="playSound(this, 'sliderBeatles/engine1/dil.mp3');">
<span id="dummy">
Play Sound<span></a>
</body>
【问题讨论】: