Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
in Web Technology by (47.6k points)

$input.disabled = true;


$input.disabled = "disabled";

Which is the standard way? And, conversely, how do you enable a disabled input?

1 Answer

0 votes
by (106k points)
edited by

To enable a disabled input in jQuery 1.6 and greater versions you can use the .prop()function:-

See the code below:-

$("input").prop('disabled', true);

$("input").prop('disabled', false);

Check out this Web Development Course to enhance your career! 

Browse Categories