标签:reac 输入框 span user val put nbsp lis ++
<tr>
<th width="130px"><em>*</em></th>
<td width="260px">
<input type="text" class="text02" id="userOption" list="userlist">
<datalist id="userlist">
<c:forEach items="${userlist}" var="userVo">
<option value="${userVo.userid}" aa="${userVo.num}">${userVo.userid}</option>
</c:forEach>
</datalist>
</td>
</tr>
取值:
var user_options= $("#userlist").children();
for(var i=0;i<user_options.length;i++){
if(user_options.eq(i).val().trim() == $("#userOption").val().trim()){
var user_id = user_options.eq(i).val();
var user_num =user_options.eq(i).attr("aa");
break;
}
}
标签:reac 输入框 span user val put nbsp lis ++
原文地址:https://www.cnblogs.com/24ming/p/11994003.html