jQuery Optimize link "href" selection
<p>I'm changing the class of "a" tag according to "href" file type. It works fine. Here's the code:</p>

<pre><code>    $('#divComment a[href$=".pdf"]').removeClass().addClass("pdf");
    $('#divComment a[href$=".doc"]').removeClass().addClass("word");
    $('#divComment a[href$=".docx"]').removeClass().addClass("word");
    $('#divComment a[href$=".zip"]').removeClass().addClass("zip");
    $('#divComment a[href$=".jpg"]').removeClass().addClass("image");
    $('#divComment a[href$=".xls"]').removeClass().addClass("excel");
    $('#divComment a[href$=".xlsx"]').removeClass().addClass("excel");
</code></pre>

<p>How do I optimize this code?</p>
