Reputation: 1343
I want to disable this button on document ready but I'm new to it so please help:
Here is my code:
$(document).ready function {
setTimeout("check_user()", 250);
}
please help
Upvotes: 0
Views: 91
Reputation: 33
$(document).ready(function(){
$('#buttonclass').attr('disabled', true);
});
Upvotes: 0
Reputation: 339786
The correct way to disable a button in current versions of jQuery is:
$('#btnid').prop('disabled', true);
.attr()
is the old way. See the jQuery 1.6.1 release notes for more information.
Upvotes: 2
Reputation: 45589
$(document).ready(function(){
$('#btnId').attr('disabled', 'disabled');
});
Upvotes: 0
Reputation: 5426
If button's id is button1, this should work.
$('#button1').attr('disabled', 'disabled');
Upvotes: 4