javascript 下拉列表 自动取值 无需value

来源:互联网 发布:国际经济合作 数据 编辑:程序博客网 时间:2024/09/21 06:36
                                    <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);}

不做解释,靠谱好用,自己试试

0 0
原创粉丝点击