title: Changing color of a div (alternate rows)
body: <p>I have a div which loops dynamically. What I want is every new row should have alternate color i.e first row's div bg will be lets say white and second row's div bg will have grey as the background. </p>
  
  <p>Here's the html </p>
  
  <pre><code>&lt;div class="container serchcntent"&gt; &lt;!-- bg color change in his div--&gt;
            &lt;div class="row"&gt;
                &lt;div class="col-md-3 col-sm-3 col-xs-12"&gt;
                    &lt;div class="serbg"&gt;
                        &lt;div class="serhead"&gt;Institute&lt;/div&gt;
                        &lt;span class="institute_name"&gt;Yak Group&lt;/span&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="col-md-3 col-sm-3 col-xs-12"&gt;
                    &lt;div class="serbg"&gt;
                        &lt;div class="serhead"&gt;Date&lt;/div&gt;
                        &lt;span class="start_date"&gt;08/Feb/2017&lt;/span&gt;
                        &lt;div class="subheadsp"&gt;&lt;span class="duration"&gt;2Days&lt;/span&gt;&lt;/div&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="col-md-3 col-sm-3 col-xs-12"&gt;
                    &lt;div class="serbg"&gt;
                        &lt;div class="serhead"&gt;Place&lt;/div&gt;
                        &lt;span class="venue"&gt;Mubai&lt;/span&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="col-md-3 col-sm-3 col-xs-12 ss"&gt;
                    &lt;div class="serbg"&gt;
                        &lt;div class="serhead"&gt;Course Fee&lt;/div&gt;
                        &lt;span class="fee"&gt;&lt;/span&gt;
                        &lt;div class="subhead"&gt;&lt;/div&gt;
                        &lt;a href="" class="book_now" batch-id=""&gt;Book Now&lt;/a&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
  
            &lt;/div&gt;
        &lt;/div&gt;
  </code></pre>