Home >Web Front-end >Layui Tutorial >Layui implements a method to dynamically disable select drop-down
The specific implementation code is as follows:
(Learning video sharing: javascript video tutorial)
Front-end code
js code
// 禁止select点击 function disSelect() { var level = $('#is_level1').val(); if(level != 1){ layer.msg('一级分类父级不可修改'); $('select').attr('disabled', 'disabled'); form.render('select'); } } // 禁止select点击 disSelect();
Related recommendations: layui
The above is the detailed content of Layui implements a method to dynamically disable select drop-down. For more information, please follow other related articles on the PHP Chinese website!