...

View Full Version : Getting the text/label value of a drop down box



jason_kelly
10-04-2011, 01:16 AM
Hello,

I need your help.

I am using the code below to attempt to get the text or label value of the drop down box, however, what I am not liking is that it is returning a number of the selected item, as opposed to the text value.



document.getElementById('status').value


How can I get just the text value of the selected item in question?

Much thanks and appreciation for all your help.

Cheers,

J

xelawho
10-04-2011, 01:49 AM
maybe this:



sel=document.getElementById('status');
txt=sel.options[sel.selectedIndex].text;
alert(txt)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum