Wouldn't var i have to be set to -1:
for (var i = -1; els[++i];) ?
Otherwise, the alert won't trigger on the first li element. for (var i = -1; els[++i];) ?
Otherwise, the alert won't trigger on the first li element.
But yeah, if we're gonna be super nitpicky, yeah sure, improve the for loop also, while we're at it.