嗨,当我单击时我试图播放一首歌,当我再次单击它时暂停,但它似乎只是在播放,这是下面的代码:
Javascript
function StartOrStop(audioFile)
{
var audie = document.getElementById("myAudio");
if(!audie.src)
audie.src = audioFile;
if(audie.paused == false)
{
audie.pause();
}
else
{
audie.play();
}
}
HTML5
<img src="images/play.png" alt="Play Button width="57" height="50" onclick="StartOrStop('RWY.mp3')" >
关于如何修复它的任何建议?