jsp在select中的option中编写if标签

Posted 爱跳舞的程序员

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jsp在select中的option中编写if标签相关的知识,希望对你有一定的参考价值。

<select onchange="lxx(this)">
<option value="">全部</option>
<option value="水电" <c:if test=‘${lx=="水电"}‘>selected=selected</c:if> >水电</option>
<option value="火电" <c:if test=‘${lx=="火电"}‘>selected=selected</c:if>>火电</option>
<option value="风电" <c:if test=‘${lx=="风电"}‘>selected=selected</c:if>>风电</option>
<option value="光伏" <c:if test=‘${lx=="光伏"}‘>selected=selected</c:if>>光伏</option>
</select>







以上是关于jsp在select中的option中编写if标签的主要内容,如果未能解决你的问题,请参考以下文章

option里面不能用<c:if></c:if>标签

jsp中通过代码改变select的option

关于java 获取 html select标签 下拉框 option 文本内容 隐藏域

js中创建html标签加入select下默认的option的value和text删除select元素节点下全部的OPTION节点

用jquery和js获取select标签中选中的option值及文本

关于HTML标签<select>的事件