title: jQuery add class to href if link contains specific text
body: <p>I have some dynamically populated links in a list on my site that link to files. Is it possible to use jQuery to see if the name of the file ends with .pdf and add a class to the href or similar if the link text ends with .mp3?</p>
  
  <p>For example I have the following links in my list:</p>
  
  <ul>
  <li>Document1.pdf</li>
  <li>Song1.mp3</li>
  <li>Song2.m4a</li>
  <li>Document2.doc</li>
  </ul>
  
  <p>I would like to detect the end letters and add different classes to the links, so to the link which has the text Document1.pdf I'd add the class <code>pdf</code> to the anchor element, and the link with the text Song1.mp3 I'd add the class <code>mp3</code> to the anchor element.</p>