I'm creating new < li > elements with a live() click function, but jquery won't tell me the index of newly created elements. Here's the code:
$esl = $('.dynamicLink');
$esl.live('click',function(){
var dynamicIndex = $esl.index(this);
alert(dynamicIndex);
});
Whenever I click the dynamicLink, it returns "-1" as the index. Any suggestions?