JS:
$(function(){
$(".remove").click(function(){
$("<need the right selector>").hide();
});
});
HTML:
<div class="tag-collection">
<div class="key">PULMONARY_EMBOLISM <span class="remove">✘</span></div>
</div>
I would ilke the above jQuery code to delete the entire div tag-collection. However, I will have many tag-collection divs on the page, and I want to make sure that when someone clicks the remove button that it only deletes the tag-collection div that the remove button was contained in.
Emphasis on line #3.
Edit: As Kevin B states below, replacing
parents()withclosest()is probably better, since that will only select one ancestor.