I have this strange problem I can't get my head around. I try to find the highest number in a list of elements which have a data-index attribute for their respective number. But when iterating over them, JS insists that 9 < 10 is false.
See this fiddle: http://jsfiddle.net/1ztbxbjx/
What I'm doing wrong?
I can't use
for (i = 0; i < $('div[data-index]'; i++))
Sometimes there will be numbers out of order in the list (eg. 1,2,3,4,5,25,31).