首页 > 技术文章 > layui中选中select标签 隐藏div

tine 2018-01-10 10:34 原文

在select标签中添加

lay-filter="cartype"
<script type="text/javascript">
        form.on('select(cartype)', function(data){ 
            if(data.value == '2'){
                $("#starttime").show();
                $("#endtime").show();
            }else{
                $("#starttime").hide();
                $("#endtime").hide();
            }
        }); 
    </script>

 

推荐阅读