I\'m trying to create a div
popup gallery type thing. But I\'m having an issue with my approach.
I have a few linked thumbnail images, which link to the lar
Use class instead of ID, repeating ID's isn't a good idea.
Using classes you solve your problem: jsfiddle
<a href="www.google.com" class="galImage">
<img src="http://www.savoryspiceshop.com/content/mercury_modules/cart/items/3/0/3/3030/rogan-josh-salt-free-thumbnail-fw232.jpg">
</a>
<br />
<a href="www.yahoo.com" class="galImage">
<img src="http://www.savoryspiceshop.com/content/mercury_modules/cart/items/2/9/8/2986/italian-herbs-salt-free-thumbnail-fw232.jpg">
</a>
$('.galImage').click(function(e){
e.preventDefault();
alert($(this).attr("href"));
});