正确使用getElementByTagName获取数组

<script type=”text/javascript”>       var j,color=new Array(“#FF0000”,”0000FF”);       j=0;       function blinkText(){          var sections=document.getElementsByTagName(“font”);           for(var i=0;i<sections.length;i++){               var section=sections[i];               if(section.getAttribute(“blink”)==”yes”){                   section.style.color=color[j];               }           }           setTimeout(“blinkText()”,1000);                   if(j==0)                       j=1;                   else                       j=0;         }       blinkText(); </script> <font blink=”yes”>第一闪</font><br> <font blink=”yes”>第二闪</font><br> <font blink=”yes”>第三闪</font><br> <font blink=”yes”>第四闪</font><br>

Comments