Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox: Read the text of the selected object

Status
Not open for further replies.

innu

Programmer
Jun 13, 2001
40
AT
Hi,

I want to click on an entry in my listbox and there should be an alert with the TEXT of the entry (not the VALUE!!!).

On onclick I call a function, there I want to give out the text of the selected listbox.


Does anyone have an idea?
sl,

Innu
 
Try this:
[tt]
<select onChange=&quot;alert( 'text: ' + this.options[ this.selectedIndex ].text )&quot; >
<option value='1'>One</option>
<option value='2'>Two</option>
<option value='3'>Three</option>
<option value='4'>Four</option>
</select>
[/tt]
Cheers, Neil :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top