Home  >  Article  >  Web Front-end  >  Layui implements a method to dynamically disable select drop-down

Layui implements a method to dynamically disable select drop-down

王林
王林forward
2020-11-25 16:09:373590browse

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!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete