title: Add class (odd and even) in html via javascript?
body: <p>I have this code example:</p>
  
  <pre><code>&lt;section class="timeline"&gt;
      &lt;article class="post "&gt;
      &lt;article class="post "&gt;
      &lt;article class="post "&gt;
      &lt;article class="post "&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p>Now i want to know how to add a class via javascript to article element.
  For example:</p>
  
  <p>1st article add class "left"</p>
  
  <p>2nd article add class "right"</p>
  
  <p>3rd article add class "left"</p>
  
  <p>4th article add class "right"</p>