I have a combobox with some values :
<select id="combo" name="my_combo" size="0" onchange="myFunction(this.getFocusedValue)">
<option value="1">1 Me开发者_开发问答se</option>
<option value="2">2 Mesi</option>
<option value="3">3 Mesi</option>
<option value="4">4 Mesi</option>
</select>
I want to translate that this.getFocusedValue
on a real JavaScript code :)
How can I do this? Would be nice if this works on all browser (else i can use Jquery).
Thanks
SOLUTION
<select id="combo" name="my_combo" size="0" onchange="changeArticle(this.options[this.selectedIndex].value)">
this.selectedIndex;
Edit:
index = this.selectedIndex;
return this.options[index].value;
精彩评论