title: How to implement "prevUntil" in Vanilla JavaScript without libraries?
body: <p>I need to implement the functionality of jQuery's <a href="https://api.jquery.com/prevUntil/" rel="nofollow noreferrer"><code>prevUntil()</code></a> method in Vanilla JavaScript.</p>
  
  <p>I've got several <code>&lt;div&gt;</code> elements on the same level:</p>
  
  <pre><code>&lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I'm trying to use an <code>onclick</code> event to find the <code>event.target</code>'s <code>previousSiblings</code> <em>until</em> a certain criteria is reached (for example, a class name match) then stop.</p>
  
  <p>How do I achieve this?</p>