I’ve got some server side PHP code that dynamically displays thumbnails of all the images contained in a directory:
<form>
<input type="hidden" name="animal">
<div id="thumbs">
\\ Dynamically created thumbnails start
<img src="images/bat.jpg">
<img src="images/cat.jpg">
<img src="images/rat.jpg">
\\ Dynamically created thumbnails end
</div>
</form>
I want the correct jQuery syntax so that when a user clicks on one of the images it:
- Removes border styles from all of the thumbnails
- Highlights the selected thumbnail by adding a coloured border
- Changes the value of the form field “animal” to the file name shown in the image.
Any help much appreciated.
If by “removes formatting on thumbnails” means removing all css on your images, then I think what you want is this.