vendredi 5 février 2016

The checkbox is not worked ,in jquery

Hello: i have problem whit the checkbox ,i tried to make a button when it's checked its enable otherwise it's disable but it's not worked well, when i chekcked it enable but when i unchecked that it show the button enable .looking forward for yours help.

$(document).ready(function(){    
    $('#agree').change(function(){
       state = $('#agree').attr('value');
       if ( state == 'on'){
          $('#continue').removeAttr('disabled');
       }else if (state == '') {
          $('#continue').attr('disabled','disabled');
       }
    });
});




Aucun commentaire:

Enregistrer un commentaire