code quality improvement

* remove redefinition of `var options`
* explicit loop assignment
* ` _$li` and `selectedIndex` leak variable to global namespace (typo on ';' should be ',')