Hi,
I currently have the following in JQuery 1.3.2
for (i = 0; i < totalPages; i++) {
var newDiv = $("<a href=\"#\">").append(i+1).click(function()
{
alert(i+1);
});
$('#pageLinks').append(newDiv).append(" ");
}
This outputs a list of numbers as required, but the alert when clicking the generated element is returning the totalPages value, not the value of i during the loop. How do I get the click event to alert the value of i instead?
Thanks