首页 > 其他 > 详细

下拉框选择绑定change事件

时间:2019-07-13 10:57:47      阅读:289      评论:0      收藏:0      [点我收藏+]

例:select下拉选绑定change动态隐藏与显示

   function selectChange() {
        $("select[name=‘sic‘]").change(function(){
            var selected=$(this).children(‘option:selected‘).val()
            if(selected=="1"){
                  $("div[data-container-for=‘otherclass‘]").hide();
                  $("div[data-container-for=‘othermethod‘]").hide();
                $("label[for=‘otherclass‘]").parent().hide();
                $("label[for=‘othermethod‘]").parent().hide();
            }else if(selected=="0"){
                $("div[data-container-for=‘otherclass‘]").show();
                $("div[data-container-for=‘othermethod‘]").show();
                $("label[for=‘otherclass‘]").parent().show();
                $("label[for=‘othermethod‘]").parent().show();
            }
        });
    }

 

下拉框选择绑定change事件

原文:https://www.cnblogs.com/water-1/p/11179561.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!