下拉框选择绑定change事件

匿名 (未验证) 提交于 2019-12-02 23:48:02

例: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();             }         });     }

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!