Last active
August 29, 2015 14:16
-
-
Save codenamejason/b8d8ac999513e380c46b to your computer and use it in GitHub Desktop.
Modify specified document types in links with a new class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a[href]').each(function() { | |
if((C = $(this).attr('href').match(/[.](pdf|doc|docx|xls)$/))) { | |
$(this).addClass(C[1]); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment