DIV 问题,这个问题比较简单,但解决不知道怎么解决
<DIV id= "d1 "> <bgsound src= 'OK.mid ' loop= '1 ' /> </DIV>
这个层已经显示,然后需要多次加入下面的字符串
getElementByID( "d1 ").innerHTML+= "test <br /> ";
但每次都听到声音,请问如何解决,类似的bgsound有几百行,笨方法肯定不行
------解决方案--------------------这样
<DIV id= "d1 "> <bgsound src= 'OK.mid ' loop= '1 ' /> </DIV>
<input onclick= "aa() " type=button value=Add>
<script>
function aa()
{
s = document.createTextNode( "test ")
document.getElementById( "d1 ").appendChild(s)
s = document.createElement( "br ")
document.getElementById( "d1 ").appendChild(s)
}
</script>
------解决方案--------------------也可以
<DIV> <bgsound src= 'sanbao.mp3 ' loop= '1 ' /> <span id= "d1 "> </span> </DIV>
<input onclick= "aa() " type=button value=Add>
<script>
function aa()
{
document.getElementById( "d1 ").innerHTML+= "test <br/> "
}
</script>