title: If nth-child(variable) has class active, add class active to nth-child of another Element
body: <p>I want to add class .active to my custom bootstrap pagination.</p>
  
  <p>Currently it works good when I navigate by clicking the pagination, but if i use the arrows the next item in my pagination doesn't get active.</p>
  
  <p>So, basically I want to see which child-element of the .carousel element is active, and add the class active to the same (for example second) child element in my pagination. </p>
  
  <pre><code>$('.sb-links a').click(function(q){
    q.preventDefault();
    targetSlide = $(this).attr('data-to')-1;
    $('#myCarousel').carousel(targetSlide);
    $('a').removeClass('active');
    $(this).addClass('active').siblings().removeClass('active');
  });
  </code></pre>
  
  <p>The code would look something like this, but its not even working if i type the child element manually.</p>
  
  <pre><code>if ( $('.carousel-inner div:nth-child(1)').hasClass('active') ) {
    $('.sb-links a:nth-child(1)').addClass('active');
  };
  </code></pre>
  
  <p>Thanks in advance for help!</p>