This isn't about a broken script, as I've been able to get it to work. It's about a weird (to me) occurrence in an incrementing variable.
ETA: Solved! It's counting all the divs in the page. Headdesk time!
( cut for code )
ETA: Solved! It's counting all the divs in the page. Headdesk time!
( cut for code )