1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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