layui 监听单选框(radio)点击事件
//html代码 <div class="layui-form-item"> <label class="layui-form-label">单选框</label> <div class="layui-input-block"> <input type="radio" lay-filter="sex" name="sex" value="男" title="男" checked=""> <input type="radio" lay-filter="sex" name="sex" value="女" title="女"> </div> </div> //js代码 layui.use(['form', 'layer', 'jquery' ], function () { $ = layui.jquery; var layer = layui.layer, form = layui.form; //监听多选框点击事件 主要是通过 lay-filter="sex" 来监听 form.on('radio(sex)', function (data) { console.log( data ); }); }