How do I disable/enable a form element?

Reading time: less than 1 minute

How do I disable/enable a form element?

// Disable #x
$( "#x" ).prop( "disabled", true );

// Enable #x
$( "#x" ).prop( "disabled", false );

Note: Using jQuery