title: Is it possible to select a specific number of closest siblings
body: <p>I have an amount of div elements, i would like to target a specific number of the closet elements, in this case the closest 2 either side of itself and add a class.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
    var dot = $('.dot3');
    if (dot.length &gt; 5) {
      var activeDot = $('.dot3.active');
      var closestDots = $(activeDot).siblings(3);
      $(closestDots).css('background-color', '#ff0000');
      $(activeDot).css('background-color', '#ff0000');
    }
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.dot3 {
    background-color: #000;
    height: 10px;
    width: 10px;
    border-radius: 100%;
    display: inline-block;
    margin: 5px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="dot3"&gt;
  &lt;/div&gt;
  &lt;div class="dot3"&gt;
  &lt;/div&gt;
  &lt;div class="dot3"&gt;
  &lt;/div&gt;
  &lt;div class="dot3 active"&gt;
  &lt;/div&gt;
  &lt;div class="dot3"&gt;
  &lt;/div&gt;
  &lt;div class="dot3"&gt;
  &lt;/div&gt;
  &lt;div class="dot3"&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>