
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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 Color Disabled Property
The HTML DOM Input Color disabled property sets/returns whether Input Color is enabled or disabled.
Syntax
Following is the syntax −
- Returning boolean value - true/false
inputColorObject.disabled
- Setting disabled to booleanValue
inputColorObject.disabled = booleanValue
Boolean Values
Here, “booleanValue” can be the following −
booleanValue | Details |
---|---|
true | It defines that the input color is disabled. |
false | It defines that the input color is not disabled and it is also the default value. |
Example
Let us see an example of Input Color disabled property −
<!DOCTYPE html> <html> <head> <title>Input Color Disabled</title> </head> <body> <form> Color Picker: <input type="color" id="Color" disabled> </form> <button onclick="enableColorInput()">Enable Color Input</button> <div id="divDisplay"></div> <script> var divDisplay = document.getElementById("divDisplay"); var inputColor = document.getElementById("Color"); divDisplay.textContent = 'Color Input disabled: '+inputColor.disabled; function enableColorInput() { inputColor.disabled = false; divDisplay.textContent = 'Color Input disabled: '+inputColor.disabled; } </script> </body> </html>
Output
This will produce the following output −
Before clicking ‘Enable Color Input’ button −
After clicking ‘Enable Color Input’ button −
Advertisements