[jQuery] problems with dynamic click event... how do I get the index in there ?
hi folks, if anyone could direct me in the right direction here I'd be
very happy
what's wrong here :
$( calculationsArray ).each(function(){
var index = $( calculationsArray ).index(this);
$( ".calculations_list" ).append( "<li
class='calculations_menu_list'>"+ (index+1)+"</li>")
.click( function(){
var i = $( this ).index( this );
alert( i );
});
});
im trying to get the index into the event. either the index that i
have already defined before the event
or extracting it from the element with the event on it...
many thanks