当前位置: 代码迷 >> 综合 >> 【Layui】------- checkbox 监听选中并取消其它选中
  详细解决方案

【Layui】------- checkbox 监听选中并取消其它选中

热度:27   发布时间:2023-12-17 01:40:37.0
   <input type="checkbox" lay-skin="primary" class="checkboxs" lay-filter="checkboxs" name="IS_USE_M5" title="执行1次"><input type="checkbox" lay-skin="primary" class="checkboxs" lay-filter="checkboxs" name="IS_USE_M6" title="执行2次">
   layui.form.on('checkbox(checkboxs)', function(data){var name=data.elem.name;if(data.elem.checked){$('.checkboxs').each(function(){var _name=$(this).attr("name");if(_name==name) return;$(this).prop("checked", false);layui.form.render();})}});

 

  相关解决方案