js元素状态切换

 1 $(document).on('change','#c-is_grade',function () {
 2    if($(this).val()==0){
 3      $('#c-total_score').parents('.form-group').hide();
 4      $('.score_box').hide();
 5    }else if($(this).val()==1){//评分
 6      $('#c-total_score').parents('.form-group').show();
 7      $('.score_box').show();
 8    }
 9 });
10 
11         $(document).on('change','#c-is_scan',function () {
12             if($(this).val()==0){ //
13                 $('#c-scan_num').parents('.form-group').hide();
14             }else if($(this).val()==1){
15                 $('#c-scan_num').parents('.form-group').show();
16             }
17         });

猜你喜欢

转载自www.cnblogs.com/codeninja/p/12048298.html