title: How to get the index of the list active element when there are no ids
body: <p>How can I select the index of the <code>.active</code> <code>&lt;li&gt;</code> element?</p>
  
  <pre><code>&lt;ul class="pagination"&gt;
      &lt;li class="paginate_button page-item previous" id="DataTables_Table_0_previous"&gt;
          &lt;a tabindex="0" class="page-link" aria-controls="DataTables_Table_0" href="#" data-dt-idx="0"&gt;‹&lt;/a&gt;
      &lt;/li&gt;
      &lt;li class="paginate_button page-item "&gt;
          &lt;a tabindex="0" class="page-link" aria-controls="DataTables_Table_0" href="#" data-dt-idx="1"&gt;1&lt;/a&gt;
      &lt;/li&gt;
      &lt;li class="paginate_button page-item active"&gt;
          &lt;a tabindex="0" class="page-link" aria-controls="DataTables_Table_0" href="#" data-dt-idx="2"&gt;2&lt;/a&gt;
      &lt;/li&gt;
      &lt;li class="paginate_button page-item next disabled" id="DataTables_Table_0_next"&gt;
          &lt;a tabindex="0" class="page-link" aria-controls="DataTables_Table_0" href="#" data-dt-idx="3"&gt;›&lt;/a&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Here is what I tried, but it returns always <code>1</code>:</p>
  
  <pre><code>var pageNumber = $('.pagination .page-item.active:first').index();
  </code></pre>