jQuery - Clicks

Discussion in 'jQuery' started by cancer10, Jan 28, 2009.

  1. #1
    Hi

    I have 3 different images on my page, with same IDs for each. And names for each images as img1, img2, img3 respectively

    I am using the following function in jQuery, but for some reason, the alert prompts me with the first image name no matter which image i click.


    
    $(document).ready(function(){
    				   	$("#img_skin").click(function(){
    												  
    							
    																							alert($("#img_skin").attr("name"));
    																						 });
    
    Code (markup):
    Plz help

    Thanx
     
    cancer10, Jan 28, 2009 IP