I use the following code to select all external links on the page
items = jQuery("a[href^=\'http:\']").not("[href*=\'" + window.location.host + "\']");
But I need to exclude links from tags with some known classes, e.g. I want to exclude "class1" and "class4" and select whatever have left.
<body>
<div>
<p class="class1">
<span class="class2"><a href="#">link</a></span>
<span class="class2"><a href="#">link</a></span>
</p>
</div>
<p class="class3"><a href="#">link</a></p>
<div class="class4"><a href="#">link</a></div>
<a href="#">link</a>
</body>
Thanks in advance