Reputation: 498
I have this button with multiple data attributes, and i want to hide it by selecting it based on class and two data attributes.
<a href='#' class='wishlist-icon' data-wish-name='product' data-wish-url='/product'>Button</a>
$(".wishlist-icon [data-wish-name='product'] [data-wish-url='/product']").hide();
I don't know why this selector doesn't work.
Upvotes: 3
Views: 5673
Reputation: 40970
Just remove the space between the selector.
$(".wishlist-icon[data-wish-name='product'][data-wish-url='/product']").hide();
Upvotes: 7