title: jQuery check if element has sibling
body: <p>I need a tip from you. I've a table with buttons in each row. Sometimes the row can have one button and sometime two. Now I'm trying to set a class which sets a margin-right to the left button (in case there are 2 buttons) to make a little gap between them.</p>
  
  <p>This is my code:</p>
  
  <pre><code>if (jQuery('.woocommerce-orders-table__cell-order-actions a').next('a').length &gt; 1) {
      jQuery(this).addClass('no-arrow margin-right');
  } else {
      jQuery(this).addClass('no-arrow');
  }
  </code></pre>
  
  <p>But now I've the problem that the table looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/S49uOm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S49uOm.png" alt="enter image description here"></a></p>
  
  <p>As you can see there is no gap between the buttons at the bottom.</p>