title: Using JavaScript, how would I write 'if the next sibling has the specific class name xxx, do this, else do that'?
body: <p>So far my code is as follows:</p>
  
  <pre><code>if(current.nextElementSibling) {
      // add --current to next sibling
      current.nextElementSibling.classList.add('about__slide--current');
  } else {
      // add --current to start
      slides[0].classList.add('about__slide--current');
  }
  </code></pre>
  
  <p>But as you can see it just checks if there is a sibling element and not if there is a sibling element with a specific name.</p>
  
  <p>Thank you.</p>