javascript - RemoveAttr doesn't remove disabled -


   <input type="checkbox" name="checking">j'accepte les conditions    <input type="submit" value="valider"  id="valide" disabled/>  <script>     $(document).ready(function(){           if((input=$("input:checkbox[name=checking]").is(":checked"))){             $("#valide").prop('disabled',true);          }  });     </script> 

hi, want enable button (valide) when checked checkbox

you must add listener check box call function every time when user check or uncheck

try sloution :)

   <input type="checkbox" onclick="check()" name="checking">j'accepte les            conditions    <input type="submit" value="valider"  id="valide" disabled/>           function check(){     if($('input[name=checking]').is(":checked")){         $("#valide").prop('disabled',false);     }else{     $("#valide").prop('disabled',true);     }     } 

please sure add javascript code after html code

demo click here


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -