Hello,
My hair falls out!
Is it possible to retrieve the "ordering value" of the <option> that
was clicked inside a range of options ?
In other words, with something like
<option value="myvalue">mytext</option>
is it possible to know the position of that <option> between the other
<option>s and retrieve that value through javascript ?
Here is the simplified code, where "myvar" is the variable that should
somehow become the position of the clicked option:
<html>
<head>
<script>
function g(myvar)
{
alert('You clicked on the ' + myvar + 'th option.')
}
</script>
</head>
<body>
<select name="n" onChange="g(this.value)">
<option value="a">111
<option value="b">222
<option value="c">333
</select>
</body>
</html>
Many thanks
Bart