One way is shown below:
<html>
<head>
<script type="text/javascript">
function testit(selobj){
var selectedOption = selobj[selobj.selected Index];
var label = selectedOption. firstChild.node Value;
alert(label)
}
</script>
</head>
<body>
<select id="sel1" onchange="testi t(this)">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three </option>
<option value="4">Four</option>
<option value="5">Five</option>
</select>
</body>
</html>
"Crescionin i Sascha" <sascha.crescio nini@coop.ch> wrote in message
news:bgal7o$kgd $1@rex.ip-plus.net...[color=blue]
>
>
> hello ng
>
> is there a way to get the selected item-label (not value)
> of a dropdown-element using js?
>
> any idea?
>
> greets
> sascha
>
>[/color]
"Crescionin i Sascha" <sascha.crescio nini@coop.ch> writes:
[color=blue]
> is there a way to get the selected item-label (not value)
> of a dropdown-element using js?[/color]
selectRef.optio ns[selectRef.selec tedIndex].text
An option element has two properties: value and text.
/L
--
Lasse Reichstein Nielsen - lrn@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'
Comment