Checkbox to Validate Textbox

JavaScript

by Sayham Chowdhury

HTML

<span class="text">Example..</span></br>
<input type="checkbox" id="checkBox" />
<input type="text" id="textInput" />

CSS

.text{
  color: teal;
  font-size: 24px;
  font-weight: bold;
}

JavaScript

$('#checkBox').prop('checked', true);
$('#textInput').prop('disabled', true);
$('#checkBox').change(function () {
    $('#textInput').prop('disabled', $(this).is(':checked'));
});