我想在我的网站上播放随机音轨..没有任何前进/后退控制..我使用的代码是..
<script type="text/javascript">
var a = Math.random()*2;
a=Math.floor(a);
if(a==1)
{alert(a); document.getElementById('soundtrack').innerHTML="<audio id='background_audio1' loop autoplay><source src='6.ogg' type='audio/ogg'>Your browser does not support the audio element.</audio>";}
if(a==0)
{alert("hello");document.getElementById('soundtrack').innerHTML="<audio id='background_audio1' loop autoplay><source src='5.ogg' type='audio/ogg'>Your browser does not support the audio element.</audio>";}
</script>
<div id="soundtrack">
</div>
但是这段代码没有播放任何东西..(警报进展顺利)我该怎么办???