下拉列表:
得到选中的菜单,以及菜单的内容
var selectIndex = document.getElementById("approveWordInfo").selectedIndex;//获得是第几个被选中了
var selectText = document.getElementById("approveWordInfo").options[selectIndex].text
当下拉列表的属性为disabled时,是得不到value值的
<c:if test="${accountTypeName eq '下游' }">
<select name="account_type_name" id="account_type_name" disabled>
<option value="上游">上游</option>
<option value="下游" selected>下游</option>
<option value="">--请选择---</option>
</select>
本文介绍如何通过JavaScript操作下拉列表,包括获取选中的菜单项及其内容,以及在特定条件下设置列表项的禁用状态。具体展示了在不同场景下使用下拉列表的实践案例。

被折叠的 条评论
为什么被折叠?



