Reputation: 12913
Is there a way to take:
$(function(){
$("#myDiv a").attr("target","_blank");
});
and say all links in #mydiv
that don't have a class of btn
should open in a new tab?
Upvotes: 1
Views: 16
Reputation: 782166
Use a :not
modifier in the selector.
$("#myDiv a:not(.btn)").attr("target", "_blank");
Upvotes: 1