HTML DOM Input Week disabled Property
-- Learning not just technology, but dreams!
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Local Bookmarks
JavaScript Reference Manual
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
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>
Input Week disabled Property
Example
Disable the week field:
document.getElementById("myWeek").disabled = true;
Output result:
Definition and Usage
The disabled property is used to set or return whether the week field is disabled.
An element with the disabled property is unusable and unclickable. Disabled elements are usually rendered in gray in browsers.
This property reflects the HTML disabled attribute.
Browser Support
All major browsers support the disabled property.
Note: Internet Explorer or Firefox does not support the <input type="week"> element.
Syntax
Return the disabled property:
weekObject.disabled
Set the disabled property:
weekObject.disabled=true|false
Property Values
| Value | Description |
|---|---|
| true|false | Specifies whether the week field is available. * true - The week field is not available.* false - Default. The week field is available. |
Technical Details
| Return Value: | A Boolean. Returns true if the week field is not available, otherwise returns false. |
|---|
More Examples
Example
Check if the week field is available:
var x = document.getElementById("myWeek").disabled;
x will output:
true
Example
Disable or enable the week field:
function disableBtn() {
document.getElementById("myWeek").disabled = true;
}
function undisableBtn() {
document.getElementById("myWeek").disabled = false;
}
Related Pages
HTML Reference Manual: HTML <input> disabled Attribute
YouTip