mares
10-01-2002, 06:23 PM
Hi,
I would like to use the label of the selected option in select object?
If i use "optionName.innerText":
<select name="optionName" onchange="alert(optionName.innerText)">
<option value="1" SELECTED>Option 1</option>
<option value="2">Option 2</option>
</select>
The alert returns "Option 1 Option 2".
But i need only the label of the selected item (ie "Option 1").
Thank you!
mares
I would like to use the label of the selected option in select object?
If i use "optionName.innerText":
<select name="optionName" onchange="alert(optionName.innerText)">
<option value="1" SELECTED>Option 1</option>
<option value="2">Option 2</option>
</select>
The alert returns "Option 1 Option 2".
But i need only the label of the selected item (ie "Option 1").
Thank you!
mares