I have a list like that:
<div class="cloned"><a rel="test" href="" title=""></a></div>
<div><a rel="test" href="" title=""></a></div>
<div><a rel="test" href="" title=""></a></div>
<div><a rel="test" href="" title=""></a></div>
<div class="cloned"><a rel="test" href="" title=""></a></div>
I would like to use jQuery to select all <a> with rel=test excluding all <a> that are inside div class cloned. Something like that
$("div:not(.cloned) a[rel=test]")
Thank you
Exactly what you have will work:
You can test it here, make sure you’re inside a
document.readyhandler if you’re having issues, like this: