Remove all elements after certain element
<p>UPDATE: edited to elaborate on required functioning. After must be dynamically removed. After element2 or element1, or element4. The list could be 2000 items long. Remove all after element1244.</p>

<p>Hope that clarifies.</p>

<p>My code is:</p>

<pre><code>&lt;div id="wrap"&gt;
  &lt;div id="element1" class="ewrap"&gt;&lt;/div&gt;
  &lt;div id="element2" class="ewrap"&gt;&lt;/div&gt;
  &lt;div id="element3" class="ewrap"&gt;&lt;/div&gt;
  &lt;div id="element4" class="ewrap"&gt;&lt;/div&gt;
  &lt;div id="element5" class="ewrap"&gt;&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>How would I remove element2/3 from the above, where I am trying to remove dynamically based on them being after 'element2'? So, remove all .ewrap after #element2?</p>
