I have created a webapp using servlet and jsp where I have a dropdown tag in html as below
<select id='check' name='select1'>
<option value='1'>text1</option>
<option value='2'>text2</option>
</select>
how can I access a TEXT
not VALUE
from select box using javascript?
so I can display text1
or text2
instead of 1 & 2, in my webapp.
I tried doing this, but it always gives me the "value" text not the option text?
<%
String checkText= request.getParameter("select1");
%>
<script>
document.getElementById("check").value = '<% out.print(checkText); %>';
</script>