Find all image links and add a class to it
<p>If I have a bunch of links to an image like this:</p>

<pre><code>&lt;a href="foo.png"&gt;foo.png&lt;/a&gt; &lt;a href="foo.jpg"&gt;foo.jpg&lt;/a&gt; &lt;a href="foo.gif"&gt;foo.gif&lt;/a&gt;
</code></pre>

<p>How would I find it all with js and then add a class?</p>

<p>This is what I was thinking but that didn't work:</p>

<pre><code>$('a[href*=.png]').addClass('image-link');
$('a[href*=.jpg]').addClass('image-link');
$('a[href*=.gif]').addClass('image-link');
</code></pre>

<p>UPDATE: There was a typo in my js.  The above works.</p>
