Reputation: 10981
I have the following jQuery selector but it is not working. I am unsure of the correct syntax. What I want to do is select a link with href equal to variable star_link but only if it does not have any of the four classes shown below. Thanks for any help.
$('a[href=' + star_link + ']:not(.smalltext.colors_text.productnamecolor.colors_productname)')
Upvotes: 0
Views: 78
Reputation: 10981
Try this :
$('a[href="'+star_link+'"]:not(.smalltext, .colors_text, .productnamecolor, .colors_productname)');
Note also the double quotes after the href, wich you should always use in that context.
Upvotes: 3
Reputation: 11028
use comma b/w selectors-
$('a[href=' + star_link + ']:not(.smalltext, .colors_text, .productnamecolor, .colors_productname)')
reference multiple-selector
Upvotes: 3