Been on this one for a while now. Basically, I need to check where a href
on an anchor tag with the class .pdf-download
is empty, and if it is, hide it.
I have attempted a few options but with no luck. This is what i have so far:
$("a.pdf-download").each(function (i) {
if ($('[href]:empty',this).length == 1) {
$(this).hide();
} else {
$(this).show();
}
});
if ($(this).attr('href') != '') {
$(this).hide();
} else {
$(this).show();
}
Note that you can also do this in css with attribute selectors:
a.pdf-download[href='']{
display:none;
}
This is not supported in ie6 though.