I have some html code looking like this:
<div id='main'>
<a href=''>
<div id='otherA'>
<a href=''>
</div>
<div id='otherB'>
<a href=''>
</div>
</div>
I would like to apply the attribute "target" to elements of #main but not of #other using JQuery. I tried a few things and I think this is the closest I got but it does not seem to work.
$(document).ready(function(){
$('#main a').not(['#otherA a', '#otherB a']).attr('target', '_blank');
});