$( "div" ).click(function ( event ) { $( "div" ).each(function ( i ) { if ( this == event.target ) alert( i ); }); });