title: Timed Color change HTML
body: <p>i have table that needs to change color every 3 seconds. I have wrote a function that can change the color once but do not know how to do it in intervals.</p>
  
  <p>HTML table code</p>
  
  <pre><code>&lt;tr id="contacts_row&lt;?php echo $i; ?&gt;" class="row"&gt;
     &lt;td&gt;&lt;?php echo $row_color_test['fname'] . " " . $row_color_test['lname'] ; ?&gt;&lt;/td&gt;
     &lt;td&gt;&lt;?php echo $row_color_test['phone']; ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>Function to change color once</p>
  
  <pre><code>function changeColor(color)
  {
      var list = document.querySelectorAll(".row");
      var index;
      for (index = 0; index &lt; list.length; ++index) {
          list[index].style.color = color;
      }
  }
  </code></pre>
  
  <p>I tried the following which dint work</p>
  
  <pre><code>var array = new Array("violet","indigo","blue","green","yellow","orange","red");
  
  
  function intervalChange()
  {
     var counter=0;
     while(counter&lt;7)
      {
         changeColor(array[counter]);
         counter++;
      }
  }
  </code></pre>
  
  <p>What am I doing wrong or is there a better solution??</p>