Selecting images inside a form using jQuery
<p>I've got some server side PHP code that dynamically displays thumbnails of all the images contained in a directory:</p>

<pre><code>&lt;form&gt;
  &lt;input type="hidden" name="animal"&gt; 
  &lt;div id="thumbs"&gt;
\\ Dynamically created thumbnails start
    &lt;img src="images/bat.jpg"&gt;
    &lt;img src="images/cat.jpg"&gt;
    &lt;img src="images/rat.jpg"&gt;
\\ Dynamically created thumbnails end
  &lt;/div&gt;
&lt;/form&gt;
</code></pre>

<p>I want the correct jQuery syntax so that when a user clicks on one of the images it:</p>

<ul>
<li>Removes border styles from all of the thumbnails</li>
<li>Highlights the selected thumbnail by adding a coloured border</li>
<li>Changes the value of the form field "animal" to the file name shown in the image.</li>
</ul>

<p>Any help much appreciated.</p>
