Please see this page which has this code:
<div class="pure-control-group query-brand-by-column">
<!-- somethings else -->
<div class="pure-u-1 pure-u-sm-1-24 control-group-sub">
<a href="javascript:$(this).closest('.query-brand-by-column').remove();" class="pure-button danger">X</a>
</div>
</div>
Clicking the X link should remove its ancestor div.query-brand-by-column
as a whole but somehow it's not working. I've checked jQuery docs and this answer and the code seems absolutely all right to me but it simply doesn't work. Any idea?