At times, you may want the submit button of a form or one of its text inputs to be disabled until the user has performed a certain action (e.g., checking the “I’ve read the terms” checkbox).
Add the disabled
attribute to your input so you can enable it when you want. You can try clicking on the submit button to see its effect.
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<title>Check image load</title>
<script>
$(function () {
$('input[type="submit"]').prop('disabled', true);
})
</script>
</head>
<body>
<form>
<input type="text" name="first" value="Taylor Swift">
<br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>

All you need to do is run the prop
method again on the input, but set the value of disabled
to false to
enable the button.
$('input[type="submit"]').prop('disabled', false);