Use jQuery to check for link extension
<p>I'm trying to read all links on the page and check if link extension is ending with '.png'. If it does, then when that link is clicked, I want to grab that image and append into div with the class 'test'. If link doesn't end with '.png' just ignore it and open normally. </p>

<p>This is markup, you can grab it on <a href="http://jsfiddle.net/Klikerko/KnvuD/1/" rel="nofollow">jsFiddle</a> too:</p>

<pre><code>&lt;a href="image01.png"&gt;Image 01&lt;/a&gt;
&lt;a href="image02.png"&gt;Image 02&lt;/a&gt;
&lt;a href="http://www.google.com/"&gt;Page&lt;/a&gt;
&lt;a href="image03.png"&gt;Image 03&lt;/a&gt;

&lt;div class="test"&gt;&lt;/div&gt;
</code></pre>

<p>... and this is how markup should look like when first link is clicked:</p>

<pre><code>&lt;a href="image01.png"&gt;Image 01&lt;/a&gt;
&lt;a href="image02.png"&gt;Image 02&lt;/a&gt;
&lt;a href="http://www.google.com/"&gt;Page&lt;/a&gt;
&lt;a href="image03.png"&gt;Image 03&lt;/a&gt;

&lt;div class="test"&gt;
  &lt;img src="image01.png" /&gt;
&lt;/div&gt;
</code></pre>

<p>Thanks!</p>
