jQuery remove the prev occurance of a class?
<p>I have a class that I want to dynamically remove based on a link.  How do I select the parent "added" class with jQuery.  There can be multibpule instances of the class I only want to remove the closest parent.</p>

<p>Example: </p>

<pre><code>&lt;div class="added"&gt;
    &lt;div class="cl"&gt;&amp;nbsp;&lt;/div&gt;
     &lt;label&gt;Add Item&lt;br /&gt;
      &lt;span&gt;What to Add&lt;/span&gt;
     &lt;/label&gt;
     &lt;div class="rightbox"&gt;
      &lt;% fields_for "items[related_items][]", add do |item_form|%&gt;
       &lt;%= item_form.text_field :add %&gt;
      &lt;%= link_to_function "remove", **"('div.added').empty()"** %&gt;
      &lt;% end %&gt;  
     &lt;/div&gt;
    &lt;div class="cl"&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;

&lt;div class="added"&gt;
    &lt;div class="cl"&gt;&amp;nbsp;&lt;/div&gt;
     &lt;label&gt;Add Item&lt;br /&gt;
      &lt;span&gt;What to Add&lt;/span&gt;
     &lt;/label&gt;
     &lt;div class="rightbox"&gt;
      &lt;% fields_for "items[related_items][]", add do |item_form|%&gt;
       &lt;%= item_form.text_field :add %&gt;
      &lt;%= link_to_function "remove", **"('div.added').empty()"** %&gt;
      &lt;% end %&gt;  
     &lt;/div&gt;
    &lt;div class="cl"&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;

&lt;div class="added"&gt;
    &lt;div class="cl"&gt;&amp;nbsp;&lt;/div&gt;
     &lt;label&gt;Add Item&lt;br /&gt;
      &lt;span&gt;What to Add&lt;/span&gt;
     &lt;/label&gt;
     &lt;div class="rightbox"&gt;
      &lt;% fields_for "items[related_items][]", add do |item_form|%&gt;
       &lt;%= item_form.text_field :add %&gt;
      &lt;%= link_to_function "remove", **"('div.added').empty()"** %&gt;
      &lt;% end %&gt;  
     &lt;/div&gt;
    &lt;div class="cl"&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
</code></pre>
