前端:select选择框配合EL表达式
<select name="test" class="btn btn-white dmp-sel-name">
<c:forEach items='${tag_item.tag_statuses }' var='list'>
<option value='${list.tag_status}' <c:if test='${tag_item.tag_status == list.tag_status}'>selected='selected'</c:if> >
<c:if test="${list.tag_status == '1'}">审批</c:if>
<c:if test="${list.tag_status == '2'}">申请</c:if>
<c:if test="${list.tag_status == '3'}">通过</c:if>
</option>
</c:forEach>
</select>
JS获取选择框值
var value = $('select[name="test"]').val();
若option
标签的selected
属性不起作用,查看是否select
标签没有name
属性,加上再试试。