YouTip LogoYouTip

Prop Search Disabled

HTML DOM Input Search disabled Property

HTML DOM Input Search disabled Property

-- Learning more than just technology, but also dreams!

JavaScript Reference Manual

Overview

JavaScript Objects

JavaScript Array Object JavaScript Boolean Object JavaScript Date Object JavaScript Math Object JavaScript Number Object JavaScript String Object JavaScript RegExp Object JavaScript Global Properties/Functions JavaScript Operators JavaScript Error

Browser Objects

Window Object Navigator Object Screen Object History Object Location Object Storage Object

DOM Objects

HTML DOM Document Object HTML DOM Element Object HTML DOM Attribute Object HTML DOM Event Object HTML DOM Console Object CSSStyleDeclaration Object DOM HTMLCollection

HTML Objects

<a> <area> <audio> <base> <blockquote> <body> <button> <canvas> <col> <colgroup> <datalist> <del> <details> <dialog> <embed> <fieldset> <form> <iframe> <frameset > <img> <ins> <input> - button <input> - checkbox <input> - color <input> - date <input> - datetime <input> - datetime-local <input> - email <input> - file <input> - hidden <input> - image <input> - month <input> - number <input> - range <input> - password <input> - radio <input> - reset <input> - search <input> - submit <input> - text <input> - time <input> - url <input> - week <keygen> <link> <label> <legend> <li> <map> <menu> <menuItem> <meta> <meter> <object> <ol> <optgroup> <option> <param> <progress> <q> <script> <select> <source> <style> <table> <td> <th> <tr> <textarea> <title> <time> <track> <video>

HTML DOM Reset Object

HTML DOM Submit Object

Explore Further

Programming

Web Service

Web Design & Development

Scripting Languages

Web Services

Software

Computer Science

Scripting

Programming Languages

Development Tools

Input Search disabled Property

Image 8: Input Search Object Reference Manual Input Search Object

Example

Disable the search field:

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

Output:

Try it yourself Β»


Definition and Usage

The disabled property is used to set or return whether a search field is disabled.

An element with the disabled property is unusable and unclickable. Disabled elements are typically rendered in gray in browsers.

This property reflects the HTML disabled attribute.


Browser Support

Image 9: Internet ExplorerImage 10: FirefoxImage 11: OperaImage 12: Google ChromeImage 13: Safari

The disabled property is supported by all major browsers.


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.
  • true - The search field is not available.
  • false - Default. The search field is available.

Technical Details

Return Value: A Boolean. Returns true if the search field is not available, otherwise false.

More Examples

Example

Check if the search field is available:

var x = document.getElementById("mySearch").disabled;

The x output will be:

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;
}

Try it yourself Β»


Related Pages

HTML Reference: HTML <input> disabled Attribute


Image 14: Input Search Object Reference Manual Input Search Object

← Prop Search FormProp Search Form β†’