1//In older versions you could use attr.
2//As of jQuery 1.6 you should use prop instead:
3$("#target :input").prop("disabled", true);
4
5//To disable all form elements inside 'target'. See :input:
6//Matches all input, textarea, select and button elements.
7
8//If you only want the <input> elements:
9$("#target input").prop("disabled", true);
1// Disable #x
2$( "#x" ).prop( "disabled", true );
3
4// Enable #x
5$( "#x" ).prop( "disabled", false );