Please see this page which has this code: 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?
jQuery closest() remove() on <a> doesn't work?
3
Please see this page which has this code:
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?
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> - anuislam
- [1] reply
- shaneburgess
- gartheekasowskih3 Banned
Next Topics on Trending Feed
-
3