1. 程式人生 > >HTML文字閃爍

HTML文字閃爍

and lang element 文字 blink scrip int dom var

<div id="blink">閃爍的文字</div>
<script language="javascript">
function changeColor(){
var color="#f00|#0f0|#00f|#880|#808|#088|yellow|green|blue|gray";
color=color.split("|");
document.getElementById("blink").style.color=color[parseInt(Math.random() * color.length)];
}
setInterval("changeColor()",200);
</script>

HTML文字閃爍