YouTip LogoYouTip

Prop Search Disabled

# Input Search disabled Property [![Image 8: Input Search Object Reference](#) Input Search Object](#) ## Example Disable the search field: document.getElementById("mySearch").disabled = true; Output: [Try it Β»](#) * * * ## Definition and Usage The disabled property is used to set or return whether a search field is disabled. An element with the disabled attribute is unusable and unclickable. Disabled elements are usually rendered in gray in browsers. This property reflects the HTML disabled attribute. * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) The disabled property is supported by all major browsers. * * * ## Syntax Return the disabled property: ```javascript _searchObject_.disabled Set the disabled property: ```javascript _searchObject_.disabled=true|false ## Property Values | Value | Description | | --- | --- | | true|false | Specifies whether the search field is available. * true - The search field is unavailable * false - Default. The search field is available | ## Technical Details | Return Value: | A Boolean. Returns true if the search field is unavailable, otherwise returns false | | --- | * * * ## More Examples ## Example Check if the search field is available: ```javascript var x = document.getElementById("mySearch").disabled; The _x_ output will be: ```text true [Try it Β»](#) ## Example Disable or enable the search field: ```javascript function disableBtn() { document.getElementById("mySearch").disabled = true; } function undisableBtn() { document.getElementById("mySearch").disabled = false; } [Try it Β»](#) * * * ## Related Pages HTML Reference: (#) * * Input Search Object](#)
← Prop Search FormProp Search Autofocus β†’