Disable / Enable Form Element Like Input Using JQuery
Here we consider how to Disable Or Enable An Input With JQuery.
Not only for input, we can disable any other HTML element by this way.
Here we enable/disable input of type Text using Jquery.
Suppose we have a TextBox with ID txtInputID as shown below.

Enable/Disable can be done by using Jquery prop or attr.
Before that we have to consider the version of Jquery.
If Jquery version is 1.6 or above, we can use Jquery prop.
$(function () {
$("input").prop('disabled', false);
$("input").prop('disabled', true);
})
$("input").prop('disabled', false); will disable the input here.
$("input").prop('disabled', true); will enable the input back.
Instead of $("input"), you can use ID or Class of the form element.
If Jquery version is 1.5 and below, we can use Jquery attr.
$(function () {
$("input").attr('disabled', 'disabled');
$("input").removeAttr('disabled');
})
$("input").attr('disabled', 'disabled'); will disable the input here.
$("input").removeAttr('disabled'); will enable the input back.
By using Jquery prop or attr we can disable any form element.