Javascript Reference
Categories: OPTION

javascript OPTION text

@March 15, 2008, 1:22 a.m.
textFirefox/Netscape/NN 2 IE 3 Chrome/Safari/DOM 1  

Read/Write  

Provides the text associated with the option element. This text is located between the start and end tags; it is what appears in the select element on screen. A hidden value associated with the list item can be stored, retrieved, and changed via the value property.

 
Example
 
var list = document.forms[0].selectList;
var listItemText = list.options[list.selectedIndex].text;
 
Value

String.

 
Default

None.


Powered by Linode.