Name

text — NN 2 IE 3 DOM 1

Synopsis

Read/Write

The text associated with the OPTION element. This text is between the start and end tags and 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.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.