title: AJAX function not passing
body: <p>I need to make that when timer ends I get "Not active" message instead of "Active". The timer and code seems to work until this <code>$('.clock').eq().countdown(inputDate)</code> after this code, the function not working, no console.log's showing when checking. The same function works on one object but when it comes to foreach loop it doesnt work. This is my html line which should replace:</p>
  
  <p><code>&lt;td&gt;&lt;span class="timeProduct label label-success"&gt;&lt;/span&gt;</code></p>
  
  <p>This is my ajax</p>
  
  <pre><code>$(document).ready(function() {
      var inputDate = new Date($('#count').text());
      var timeProduct = $(".timeProduct");
      timeProduct.html('Aktyvus');
      inputDate.setDate(inputDate.getDate() + 7);
      $(".clock").countdown(inputDate, function(event) {
              $(this).text(
                  event.strftime('%D dienos %Hh %Mmin %Ssek')
              );
  
              $('.clock').eq().countdown(inputDate)
                  .on('finish.countdown', function(event) {
                      var timeProduct = $(".timeProduct");
                      timeProduct.removeClass("label label-success");
                      timeProduct.addClass('label label-danger');
                      timeProduct.html("Pasibaigė");
                  });
  
          });
  });
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>This is my HTML with foreach loop</p>
  
  <pre><code>@foreach($bids as $b)
  &lt;tr&gt;
      &lt;td&gt;&lt;img style="height: 50px" src="{{$b-&gt;product-&gt;img_1}}"&gt;
          &lt;strong&gt;&lt;a href="/preke/{{$b-&gt;product-&gt;id}}/{{$b-&gt;product-&gt;slug}}"&gt;{{$b-&gt;product-&gt;title}}&lt;/a&gt;&lt;/strong&gt;
      &lt;/td&gt;
      &lt;td&gt;{{number_format($b-&gt;product-&gt;price, 2)}} EUR&lt;/td&gt;
      &lt;td&gt;{{$b-&gt;created_at}}&lt;/td&gt;
      &lt;td&gt;&lt;span id="count"&gt;{{$b-&gt;product-&gt;created_at}}&lt;/span&gt;&lt;/td&gt;
      &lt;td&gt;&lt;span class="clock"&gt;&lt;/span&gt;&lt;/td&gt; // This is where timer appears
      &lt;td&gt;&lt;a style="font-size: 11px" href="/unmark-auction/{{$b-&gt;id}}" class="unCheck btn btn-danger"&gt;&lt;i class="glyphicon glyphicon-remove"&gt;&lt;/i&gt; Nebesekti&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;&lt;span class="timeProduct label label-success"&gt;&lt;/span&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  @endforeach
  </code></pre>
  
  <p><strong>And this is updated AJAX</strong></p>
  
  <pre><code>$(document).ready(function() {
      var inputDate = new Date($('#count').text());
      var timeProduct = $(".timeProduct");
      timeProduct.html('Aktyvus');
      inputDate.setDate(inputDate.getDate() + 7);
      $(".clock").countdown(inputDate, function(event) {
          $(this).text(
              event.strftime('%D dienos %Hh %Mmin %Ssek')
          );
          var index = $(".clock").index(this);
          $('.clock').eq(index).countdown(inputDate)
              .on('finish.countdown', function(event) {
                  var timeProduct = $(".timeProduct");
                  timeProduct.removeClass("label label-success");
                  timeProduct.addClass('label label-danger');
                  timeProduct.html("Pasibaigė");
              });
      });
  });
  </code></pre>