Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ご覧のとおり、2 種類のアンカー タグがあります。
初め :
<a>Link</a>
そして2番目:
<a href="http://facebook.com"></a> <a href="http://twitter.com"></a>
<a>Link</a>jqueryを使用して、このタイプのタグのみを選択したいだけです。
$('a').filter(function(){ return !$(this).attr('href'); });
作業例: http://jsfiddle.net/3Sczq/
:notcssセレクターを使用する必要があります。
:not
$('a:not([href])')
属性のないすべてのaタグを選択しますhref
a
href
jQueryのドキュメントはこちら