you should not use document.write, since it is executed when the page is being loaded, try
<head>
<script>
var next;
function aa()
{
next=new Array("black","yellow","white","pink","darkgreen")
}function start()
{
document.all("dv").innerHTML = next[nextshu];
document.all("dv").style.backgroundColor = next[nextshu];
++nextshu;
nextshu %= next.length;
}function ani()
{
setInterval("start()",500)
}function window.onload()
{
nextshu=0
aa()
ani()
}</script>
</head>
<body>
<div id="dv"></div>
</body>
<head>
<script>
var next;
function aa()
{
next=new Array("black","yellow","white","pink","darkgreen")
}function start()
{
document.all("dv").innerHTML = next[nextshu];
document.all("dv").style.backgroundColor = next[nextshu];
++nextshu;
nextshu %= next.length;
}function ani()
{
setInterval("start()",500)
}function window.onload()
{
nextshu=0
aa()
ani()
}</script>
</head>
<body>
<div id="dv"></div>
</body>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货