Latest web development tutorials

HTML DOM Input Search disabled property

Input Search Object Reference Input Search Object

Examples

Disable search field:

. Document.getElementById ( "mySearch") disabled = true;

Output:


try it"

Definition and Usage

disabled property sets or returns whether the search field is disabled.

Use the disabled attribute elements are not available and can not be clicked. Disabled elements are usually displayed on the browser gray.

This property reflects the HTML disabled property.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the disabled attribute


grammar

Returns disabled properties:

searchObject .disabled

Set the disabled attribute:

searchObject .disabled = true | false

Property Value

value description
true | false Description search field is available.
  • true - the search field is unavailable
  • false - default. Search field is available

technical details

return value: Boolean value that, if the search field is unavailable returns true, false otherwise


More examples

Examples

Check the search fields are available:

var x = document.getElementById ( "mySearch") disabled.;
x The output is:
true

try it"

Examples

Disable or enable the search field:

function disableBtn () {
. Document.getElementById ( "mySearch") disabled = true;
}
function undisableBtn () {
. Document.getElementById ( "mySearch") disabled = false;
}

try it"


Related Pages

HTML Reference Manual: HTML <the INPUT> Disabled Property


Input Search Object Reference Input Search Object