i have two types of anchor tag as you can see.
First :
<a>Link</a>
and Second :
<a href="http://facebook.com"></a>
<a href="http://twitter.com"></a>
i just want to select only this type tags <a>Link</a>
using jquery.
$('a').filter(function(){
return !$(this).attr('href');
});
Working example: http://jsfiddle.net/3Sczq/
You should use the :not
css selector:
$('a:not([href])')
Select all a
tags without an attribute href
jQuery docs here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With