jquery appending in the page
<p>i'm using ajax to get some information to my page </p>

<p>the information received in an array so i use for loop to append them to my html page in this way :</p>

<pre><code>for i to i less than my information  i++

$('#ul').append("&lt;li&gt;"+info[i]+"&lt;/li&gt;");
</code></pre>

<p>but i want to add a different .click event to every 'li' tag but i don't want to loop another time for this. is there any simple way to do this ?</p>

<p>I tried those solutions but nothing seems to work :</p>

<p>A)</p>

<pre><code>for i to i less than my information  i++

$('#ul').append(   $("&lt;li&gt;"+info[i]+"&lt;/li&gt;").click(function(){alert(i)})    );
</code></pre>

<p>return the last "i" value for all of them</p>

<p>B)</p>

<pre><code>for i to i less than my information  i++

$('#ul').append("&lt;li&gt;"+info[i]+"&lt;/li&gt;").find('li:last-child').click( function( {alert(i)} )    );
</code></pre>

<p>return also the last "i" value for all of them</p>

<p>is there any simple way to do this ?</p>
