title: Getting attribute value
body: <p>I have html as below.</p>
  
  <pre><code>&lt;div class="testimonials-list"&gt;
      &lt;div class="slider testimonials-list-slider" data-index="0"&gt;
      &lt;div class="testi-list tr-slide"&gt;
              &lt;p&gt;As the clock struck midnight on Chaitra Vadi&lt;/p&gt;  
      &lt;/div&gt;
      &lt;div class="testi-list tr-slide" tr-active data-index="1"&gt;
          &lt;p&gt;the kingdom of Pundarikgiri in Mahavideh Kshetra,.&lt;/p&gt; 
      &lt;/div&gt;
      &lt;div class="testi-list tr-slide" data-index="2"&gt;
          &lt;p&gt;3 shetra, a beautiful baby a Taurus on his body was bor&lt;/p&gt; 
      &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I want to get the active div (i.e. tr-active class) and then want to access the value of attribute 'data-index'. How can we do this using jquery?</p>
  
  <pre><code>var i = $('.testi-list').find('tr-active').attr('data-index');
  </code></pre>
  
  <p>Above line is not working.</p>