Posted in: Using jQuery Core > Frequently Asked Questions

How do I disable/enable a form element?

You can enable or disable a form element using the .prop() method:

1
2
3
4
5
// Disable #x
$( "#x" ).prop( "disabled", true );
// Enable #x
$( "#x" ).prop( "disabled", false );