/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$('a[href]').each(function() { Â Â if((C = $(this).attr('href').match(/[.](doc|xls|pdf)$/))) { Â Â Â Â $(this).addClass(C[1]); Â Â } });