Input Search disabledProperty
Examples
Disable the search field:
document.getElementById("mySearch").disabled = true;
Output result:
Try it Yourself »
Definition and Usage
The disabled property sets or returns whether the search field is disabled.
Elements with the disabled attribute are disabled and unclickable. Disabled elements are usually displayed in gray in the browser.
This property reflects the HTML disabled attribute.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the disabled property
Syntax
Return the disabled property:
searchObject.disabled
Set the disabled property:
searchObject.disabled=true|false
Property Values
| Value | Description |
|---|---|
| true|false | Specifies whether the search field is available.
|
Technical Details
| Return Value: | A Boolean value, returns true if the search field is disabled, otherwise returns false |
|---|
More Examples
Example
Check whether the search field is available:
var x = document.getElementById("mySearch").disabled;
xThe output result is:true
Try it Yourself »
Example
Disable or enable the search field:
function disableBtn() {
document.getElementById("mySearch").disabled = true;
}
function undisableBtn() {
document.getElementById("mySearch").disabled = false;
}
document.getElementById("mySearch").disabled = true;
}
function undisableBtn() {
document.getElementById("mySearch").disabled = false;
}
Try it Yourself »
Related Pages
HTML Reference Manual:HTML <input> disabled attribute
Input Search Object Other Extensions