title: JS target multiple classes and repeat infinitly
body: <p>The JS below works exactly like it should, my JS knowledge is 0%. Only thing is i need the code below to target multiple divs but same id or different id's does not matter. It also needs to be infinite. so every 50 seconds it needs to repeat. The goal of the js below is to reset CSS3 animations i have running. Project files can be found here: www.dreamsynk.com/img/slider.</p>
  
  <pre><code>// retrieve the element
  element = document.getElementById("ani");
  
  setTimeout(function() {
  // -&gt; removing the class
  element.classList.remove("one");
  
  // -&gt; triggering reflow /* The actual magic */
  // without this it wouldn't work. Try uncommenting the line and the transition won't be    retriggered.
  element.offsetWidth = element.offsetWidth;
  
  // -&gt; and re-adding the class
  element.classList.add("one");
  }, (50*1000)); //40 seconds
  </code></pre>
  
  <p>UPDATES:</p>
  
  <pre><code>&lt;div class="slider"&gt;
  &lt;div class="inner"&gt;
      &lt;div id="ani" class="one"&gt;&lt;/div&gt;
      &lt;div id="ani" class="two"&gt;&lt;/div&gt;
      &lt;div id="ani" class="three"&gt;&lt;/div&gt;  
      &lt;div id="ani" class="four"&gt;&lt;/div&gt;
      &lt;div id="ani" class="five"&gt;&lt;/div&gt;
      &lt;div id="ani" class="six"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  
  // retrieve an array-like object with elements
  var elements = document.querySelectorAll("ani");
  
  setTimeout(function() {
  for (var i=0; i&lt;elements.length; i++) {
  var element = elements[i];
  element.classList.remove("one two three four five six");
  element.offsetWidth = element.offsetWidth;
  element.classList.add("one two three four five six");
  }
  }, (50*1000)); //50 seconds
  </code></pre>
  
  <p>I am doing something wrong?</p>