jquery - show textbox when checkbox checked

后端 未结 7 764
伪装坚强ぢ
伪装坚强ぢ 2021-01-21 08:44

I have this form

7条回答
  •  情深已故
    2021-01-21 09:22

    Assuming markup will stay in same order can use next()

    jQuery(document).ready(function($) {
    
        $('input.maxtickets_enable_cb').change(function(){
                    $(this).next()[ this.checked ? 'show' : 'hide']();  
        }).change();
    });
    

提交回复
热议问题