[Javascript] <select>

Shawn Milo shawn.milo at gmail.com
Tue Aug 23 13:45:54 CDT 2005


Here you go:

selectedText = selectedText +
document.forms['frmStatusReports'].drpPeriod.options[selectedIndex].text;


Shawn




On 8/23/05, Iztok Polanic <iztok.polanic at amis.net> wrote:
> Hi!
> 
> I'm trying to retrieve text of a <select> tag. If I use .value method, I
> get the value that is written inside <option> tag, but I need the text.
> For better illustration I'm providing below an example:
> 
> <select>
> <option value="1">somethhing</option>
> </select>
> 
> How to retrieve 'somethhing' with JS?
> Tnx.
> 
> --
> Bye,
> 
> Iztok
> 
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 
> 
> 
> 


-- 
Shawn Milochik

The Freelance Pen
FreelancePen.com
610-621-2648



More information about the Javascript mailing list