jQuery show/hide a div based on select value

后端 未结 7 853
走了就别回头了
走了就别回头了 2020-12-10 13:02

I have a select list with values \'all\' and \'custom\'. On select with value \'custom\' a div with class \'resources\' should appear, and if the value is \'all\' it should

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-10 13:57

    Privileges.on('change',function(){
        if($(this).val()=='custom'){
            $('.resources').show();
        }else{
            $('.resources').hide();
        }
    })
    

提交回复
热议问题