

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML DOM Input Datetime disabled Property
<p>The HTML DOM Input Datetime disabled property sets/returns whether Input Datetime is enabled or disabled.</p><h2>Syntax</h2><p>Following is the syntax −</p><ul class="list"><li>Returning boolean value - true/false</li></ul><pre class="result notranslate">inputDatetimeObject.disabled</pre><ul class="list"><li>Setting <strong>disabled </strong>to booleanValue</li></ul><pre class="result notranslate">inputDatetimeObject.disabled = booleanValue</pre><h2>Boolean Values</h2><p>Here, <strong>“booleanValue”</strong> can be the following −</p><table class="table table-bordered"><thead><tr><th style="text-align: center;">booleanValue<br></th><th style="text-align: center;">Details<br></th></tr></thead><tbody><tr><td>true<br></td><td>It defines that the input datetime is disabled.<br></td></tr><tr><td>false<br></td><td>It defines that the input datetime is not disabled and it is also the default value.<br></td></tr></tbody></table><h2>Example</h2><p>Let us see an example of <strong>Input Datetime disabled</strong> property −</p><p><a class="demo" href="http://tpcg.io/5f04Xi" rel="nofollow" target="_blank"> Live Demo</a></p><pre class="prettyprint notranslate"><!DOCTYPE html> <html> <head> <title>Input Datetime Disabled</title> </head> <body> <form> Date & Time: <input type="datetime" id="datetimeSelect" value="1998-04-09T12:48IST" disabled> </form> <button onclick="enableDatetimeInput()">Enable Datetime Input</button> <div id="divDisplay"></div> <script> var divDisplay = document.getElementById("divDisplay"); var inputDatetime = document.getElementById("datetimeSelect"); divDisplay.textContent = 'Datetime Input disabled: '+inputDatetime.disabled; function enableDatetimeInput() { inputDatetime.disabled = false; divDisplay.textContent = 'Datetime Input disabled: '+inputDatetime.disabled; } </script> </body> </html></pre><h2>Output</h2><p>This will produce the following output −</p><p>Before clicking <strong>‘Enable Datetime Input’</strong> button −</p><p><img src="https://www.tutorialspoint.com/assets/questions/media/25582/input_datetime.jpg" class="fr-fic fr-dib" style="width:600px; height:130px;" width="600" height="130"></p><p>After clicking <strong>‘Enable Datetime Input’</strong> button −</p><p><img src="https://www.tutorialspoint.com/assets/questions/media/25582/after_input_datetime.jpg" class="fr-fic fr-dib" style="width:600px; height:141px;" width="600" height="141"></p>
- Related Questions & Answers
- HTML DOM Input DatetimeLocal disabled Property
- HTML DOM Input Email disabled Property
- HTML DOM Input Time disabled Property
- HTML DOM Input URL disabled Property
- HTML DOM Input Week disabled Property
- HTML DOM Input Button disabled Property
- HTML DOM Input FileUpload disabled Property
- HTML DOM Input Month disabled Property
- HTML DOM Input Number disabled Property
- HTML DOM Input Checkbox disabled Property
- HTML DOM Input Color disabled Property
- HTML DOM Input Date disabled Property
- HTML DOM Input Password disabled Property
- HTML DOM Input Search disabled Property
- HTML DOM Input Submit disabled property
Advertisements