title: Target all links except those in DIVs using jQuery
body: <p>I want to target all links in <code>.entry-content</code>, except those in DIVs in it. So I have this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function($) {
  
    // Target all links in entry-content except those in DIVs
    $('.entry-content a')
      .not($('div a'))
      .not('[href*="' + window.location.host + '"]')
      .attr('rel', 'nofollow noopener noreferrer')
      .attr('target', '_blank');
  
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="entry-content"&gt;
    &lt;div&gt;&lt;a href="#"&gt;Exclude this&lt;/a&gt;&lt;/div&gt;
    &lt;p&gt;&lt;a href="#"&gt;Include only this&lt;/a&gt;&lt;/p&gt;
    &lt;a href="#"&gt;Or any other link as long as it's not in DIV&lt;/a&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>This part doesn't work: <code>.not($( 'div a' ))</code></p>
  
  <p>Any help would be appreciated. Thanks!</p>