I have some HTML that looks like this:
<div class="product">
Content In Here
<div class="price">
<a href="#" class="removeLink">Remove</a>
</div>
</div>
I’m trying to target the parent of the remove link like this:
$('.removeLink').click(function(event) {
event.preventDefault();
$(this).parent('.product').fadeOut('fast');
});
However for some reason it’s not working and I can’t figure out why, there is no error messages in the Javascript console, any idea why it won’t fade out the parent .product div?
I think you want
parents(), not the singular: