scusami, ho fatto un errore:

codice:
<select onchange="f(this.selectedIndex);">