Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

disable input field using jquery

//jQuery 1.6+ use:
$("#inputID").prop('disabled', true); //disable 
$("#inputID").prop('disabled', false); //enable

//jQuery 1.5 and below use:
$("#inputID").attr('disabled','disabled'); //disable 
$("#inputID").removeAttr('disabled'); //enable

$( "#x" ).prop( "disabled", true );
 
// Enable #x
$( "#x" ).prop( "disabled", false );
 
PREVIOUS NEXT
Tagged: #disable #input #field #jquery
ADD COMMENT
Topic
Name
9+6 =