No value is required for the automatic value of the javascript drop-down list.
<select id="applyType" name="$!{status.expression}" class="inp" onchange="receiptAddApplyType()" style="width:150px;"> #foreach($item in ${applyTypes}) <option value="$!{item.value}" #if($!{item.value} == $!{status.value} ) selected #end >$!{item.name}</option> #end </select>
function receiptAddApplyType(){var s=document.getElementById('applyType');alert(s[s.selectedIndex].text);}
No explanation, reliable and easy to use. Try it on your own.
How to obtain the value of the drop-down list using javascript?
Yes
For example, your down list box id is adds
Document. getElementById ("adds"). value is his value.
In fact, the drop-down box can be viewed as a text box, but by selecting a value,
There are more than one drop-down, which is eventually a value.
Note: This option is selected in the drop-down list.
The value Attribute of the select object in the javascript drop-down list. What is the return value?
Select itself does not have a value. When it is used to pass a parameter, the selected option is passed, that is, the value of the option of seleted = seleted, you can also get the above results through a simple test. Give it a try.