I feel like a bonehead: I want to assign index=i
to each LI I have selected, with i incrementing. It appears to assign them all at once though, and they all get index=1
. Thoughts?
$("#window ul li").each(function(){
var i = 1;
$(this).attr("index", i);
i++;
});