layui select渲染获取选中的option

关键代码以下:spa

form.on('select(groupCode)', function(data){ console.log($(data.elem).find("option:selected").attr("title")); }); 

 

相关代码:code

SELECT渲染以下orm

<select name="groupCode" lay-search lay-filter="groupCode">
    <option value=""></option>
    <c:if test="${list!=null }">
    <c:forEach items="${l}" var="item" varStatus="status">
    <option value="${item.id}" title="${item.age }">${item.name}</option>
    </c:forEach>
    </c:if>
</select>
相关文章
相关标签/搜索