layui下拉选择获取值,渲染赋值
html:
<select name="vod_cid" id="chang_seleced" lay-filter="chang_seleced"> <option value="">选择分类</option> <option value="1">衣服</option> <option value="2">鞋子</option> </select>
添加: lay-filter="chang_seleced"
下拉获取值:
form.on('select(chang_seleced)', function(data){ //获取select的值 console.log( data.value) });
2、渲染,赋值:
html代码:
<div class="layui-form-item"> <div class="layui-input-block" id="type"></div> </div>
js代码:form.render('select');
$('#type').html('222222'); form.render('select');
文章评论(0)