JackTheRussel
Programmer
Hi.
I have dropdown box on my page.
Now in function Stat I would like to read the selected dropdpwn box value. How can it be done?
I have tried to read the selected value like this:
But it gives me something like this:
I would expect 1 or 2.
So how can I read only the selected dropdown box value to the variable?
I have dropdown box on my page.
Now in function Stat I would like to read the selected dropdpwn box value. How can it be done?
I have tried to read the selected value like this:
Code:
var selected = document.getElementById('dropdiv').innerHTML;
But it gives me something like this:
Code:
<select name="drop" onchange="function2(this.value">
<option>select value</option>
<option>value="1">1</option>
<option>value="2">2</option>
I would expect 1 or 2.
So how can I read only the selected dropdown box value to the variable?