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
surprise to see that no have given this syntax.
.each syntax with data or collection
.each
jQuery.each(collection, callback(indexInArray, valueOfElement));
OR
jQuery.each( jQuery('#list option'), function(indexInArray, valueOfElement){ //your code here });