The other selectors that were provided in the responses are erroneous to this day. jQuery will complain:
Unused error: syntax error, unrecognized expression: a [href $ =. pdf]
The correct way to select an anchor:
jQuery('a[href$=".pdf"]');
Pay attention to quotes around .pdf
source share