My code is like this
$(\"a[href]\").each(function () {
if ($(this).attr(\"href\").toLowerCase().indexOf(\"javascript:\") != 0 && $(this).attr
You can user jquery not selector. http://api.jquery.com/not-selector/
Use filter()
:
$('a[href]').filter(function(){
return !$(this).hasClass('tax-switch');
}).each(function(){
// do your stuff
});
References:
filter()
.As @vivek has said, use the not
function:
$('a[href]').not('.tax-switch').each(
This'll select all anchors that do not have the class 'tax-switch'.
try this code , Working fiddle
$("a[href]:not(.tax-switch)").each(function () {
$("#myDIV").append('<p>'+ $(this).html()+'</p>');
});