Use not to find null in href?

Use not to find null in href?

I have the following code which works fine except I would like it to ignore anchors as well that only have the name attr and no href. Any ideas? Thanks!

  1. jQuery(document).ready(function () {
        jQuery("a").not("[href = null],[href*='google.com'],[href*='yahoo.com'],[href*='javascript'],[href*='#']").attr('target','_blank').addClass('external');
    });