Microsoft
Software
Hardware
Network
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.ge
tElementBy
Id("my_dro
pdown").va
lue;
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("m
y_dropdown
")
var dropdown_value=dropDown.op
tions[drop
Down.selec
tedIndex].
text;
or
var dropdown_value=dropDown.op
tions[drop
Down.selec
tedIndex].
innerHTML;
Random Solutions
Network / Internet issues
ALT text in Firefox
sysprep and answer file help with Windows 7
Networking a work laptop with a home network
sql server smtp port
Enabling bluetooth in Ubuntu 10.04
Sharepoint 2010 and default IIS
AJAX post returning 500 Internal Server Error on Live Server
How to ensure only one user at a time uses the MS access application?
Remove Webroot Spy Sweeper 3.1