My goal is..
When the checkbox is selected, button is enabled.
When the checkbox is not selected, button is disabled.
Defaults : checkbox is disabled
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<button type="button" id="agree" class="btn btn-primary">Let's Go!</button>
<label><input type="checkbox" id="checkbox" disabled value="">I agree.</label>
<script>
$(document).ready(function(){
if($('input:checkbox[id="checkbox"]').is(':checked') == true) {
$("#agree").attr("disabled",false);
}
else {
$("#agree").attr("disabled",true);
}
});
</script>