Enable/Disable Input with Checkbox Clicks

by ABBEYSOFT

HTML

<input type="text" id="theBox" />
<input type="checkbox" id="checker" /><label for="checker">Click Me, I'll disable this text box</label>

JavaScript

$('#checker').prop('checked', false);
$('#theBox').hide();

$('#checker').on('click', function(){
    if($(this).is(':checked')){
        $('#theBox').show();
        $('#theBox').show();    
        //alert('checked');
    }else{
        $('#theBox').hide();
        $('#theBox').hide();    
        //alert('not checked');
    }    
});

//$('#checker').button(); //Requires jQuery UI