闪烁的文字

 <div id="shanshuo">闪烁的字</div>
<script> 
 function cgc(){
var color=['#f00','#f0f','#ff0','#00f','#ccc','#ddd','#eee'];
document.getElementsByClassName("shanshuo")[0].style.color[parseInt(Math.random()*color.length)];
 }
setInterval("cgc()",200) 
</script> 
posted @ 2019-02-21 17:23  风的方向·  阅读(100)  评论(0编辑  收藏  举报