I am using
$('#list option').each(function(){
//do stuff
});
to loop over the options in a list.
I am wondering how I could get the index of the current loop?
as I dont want to have to have var i = 0;
and inside the loop have i++;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
logs the index 🙂
a more detailed example is below.