Question : getting text from a listbox in javascripts

Hi, I want to get the text rather than the value of a listbox. If I wanted to get the value, I would use this

var dropdown_value=document.getElementById("my_dropdown").value;

however I want to get the text, how could I do this?

Thanks.

Answer : getting text from a listbox in javascripts

var dropDown = document.getElementById("my_dropdown")
var dropdown_value=dropDown.options[dropDown.selectedIndex].text;
or
var dropdown_value=dropDown.options[dropDown.selectedIndex].innerHTML;
Random Solutions  
 
programming4us programming4us