title: Loop through the table and fetch the attribute of particular class only
body: <p>This is my table , how can i get the <strong>video-id</strong> for class <strong>newvideos</strong> only</p>
  
  <pre><code>&lt;table class="mytable2 table" id="videosexistingtable"&gt;
     &lt;tbody class="connectedSortable ui-sortable"&gt;
        &lt;tr&gt;
           &lt;th&gt;Name&lt;/th&gt;
           &lt;th&gt;Video&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr video-id="6" tag-id="1" class="newvideos" style="display: table-row;"&gt;
           &lt;td&gt;Video1&lt;/td&gt;
           &lt;td&gt;Data Science&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr class="existingvideos" video-id="2"&gt;
           &lt;td&gt;Video2&lt;/td&gt;
           &lt;td&gt;Data Science&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr video-id="49" tag-id="1" class="newvideos" style="display: table-row;"&gt;
           &lt;td&gt;Video49&lt;/td&gt;
           &lt;td&gt;Data Science&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr video-id="48" tag-id="1" class="newvideos" style="display: table-row;"&gt;
           &lt;td&gt;Video48&lt;/td&gt;
           &lt;td&gt;Data Science&lt;/td&gt;
        &lt;/tr&gt;
     &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>$(document).ready(function() {
      getallnewvideos();
  });
  
  function getallnewvideos() {
      $("#videosexistingtable &gt; tbody  &gt; tr .newvideos").each(function() {
          var video_id = $(this).attr('video-id');
          console.log('video_id' + video_id);
      });
  }
  </code></pre>
  
  <p>This is my fiddle: <a href="http://jsfiddle.net/cod7ceho/161/" rel="nofollow">http://jsfiddle.net/cod7ceho/161/</a></p>
  
  <p>Please let me know how to do this.</p>