Skip to content

Instantly share code, notes, and snippets.

@ppisarczyk
Last active October 4, 2020 16:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ppisarczyk/50e08b067229cb51092d7d9b40903900 to your computer and use it in GitHub Desktop.
From https://css-tricks.com/snippets/jquery/automatically-discover-document-links-and-apply-classThis will look through every a element on the page. If the href attribute of it has a .doc, .xls, or .pdf in it, it will apply the appropriate class name to it (e.g. class="doc")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment