1. I think your append string is badly formed - shouldn't it be like this?
$('#scrubberList').append('<li><span id="' + pages_arr[i] + '" index="' + i + '" class="scrubberBtn"></span></li>');
2. I think you are better off using the native jQuery attr
3. The scrubberList has no index, it is the li's that you append to it. Have a look at DOM transversal methods like nextAll() and children()