input radio 用el表达式根据值选中

不多说,直接贴代码。相信各位都能看懂!
<input type="radio" name="stusex" value="男" ${stu.stusex=='男' ? "checked=\"checked\"" : "" } ><input type="radio" name="stusex" value="女"  ${stu.stusex=='女' ? "checked=\"checked\"" : "" } ><br>
<option value="汉族" name="Nation"  ${stu.nation=='汉族' ? "selected=\"selected\"" : "" } >汉族</option>
<option value="藏族" name="Nation" ${stu.nation=='藏族' ? "selected=\"selected\"" : "" }> 藏族</option>
<option value="傣族" name="Nation" ${stu.nation=='傣族' ? "selected=\"selected\"" : "" }>傣族</option>
<option value="白族" name="Nation" ${stu.nation=='白族' ? "selected=\"selected\"" : "" }>白族</option>
<option value="赫哲族" name="Nation" ${stu.nation=='赫哲族' ? "selected=\"selected\"" : "" }>赫哲族</option>
<option value="维吾尔族" name="Nation" ${stu.nation=='维吾尔族' ? "selected=\"selected\"" : "" }>维吾尔族</option>
<option value="壮族" name="Nation" ${stu.nation=='壮族' ? "selected=\"selected\"" : "" }>壮族</option>

 

 
posted @ 2019-10-18 20:30  听~风在北边  阅读(864)  评论(0编辑  收藏  举报