HTML | DOM Input Color Object Last Updated : 24 Aug, 2022 Comments Improve Suggest changes Like Article Like Report The Input Color Object property in HTML DOM is used to create and access the <input> element within the object. The <input> is used to enter data in the input field. Declaration of input control that allow user to input data is can be done by <input> elements are used within a <form>. Syntax: It is used to access the <input> element with the type "color".var x = document.getElementById("myColor");It is used to create <input> element with the type "color".var x = document.createElement("INPUT"); Property Values: autocomplete: It is used to set or return the autocomplete attribute of a color picker.autofocus: It is used to set or return the color picker when page automatically get focus.defaultValue: It is used to set or return the default value of color picker.disabled: It is used to set or return the color picker is disabled, or not.form: It returns the reference of form that contains the color picker.list: It returns the reference of element that contains the color picker.name: It is used to set or return the name attribute of a color picker.type: It returns the type of form element the color picker.value: It is used to set or return the value attribute of a color picker. Example 1: This example describes the getElementById() method to access <input> element with type = "color" attribute. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Input Color Object </title> </head> <body> <h2> HTML DOM Input Color Object Property </h2> <p> Select your favorite color: <input type = "color" value = "#009900" id = "color"> </p> <p>Click on the button to get the color value</p> <button onclick = "myGeeks()"> Click Here! </button> <p id = "GFG"></p> <!-- script to return the input color --> <script> function myGeeks() { var x = document.getElementById("color").value; document.getElementById("GFG").innerHTML = x; } </script> </body> </html> Output: Before Click on the button: After Click on the button: Example 2: This example describes the document.createElement() method to create <input> element with type = "color" attribute. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Input Color Object </title> </head> <body> <h2> HTML DOM Input Color Object Property </h2> <button onclick = "myGeeks()"> Click Here! </button> <!-- script to create input color element --> <script> function myGeeks() { /* Create input element */ var x = document.createElement("INPUT"); /* Set color attribute */ x.setAttribute("type", "color"); /* Set color value */ x.setAttribute("value", "#009900"); document.body.appendChild(x); } </script> </body> </html> Output: Before Click on the button: After Click on the button: Supported Browsers: The browser supported by DOM Input Color Object property are listed below: Google Chrome 20Edge 14Firefox 29Opera 12Safari 12.1 Comment More infoAdvertise with us S SHUBHAMSINGH10 Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML | DOM Style transitionDuration Property The Style transitionDuration property in HTML DOM is used to set or return the length of time(in seconds or milliseconds) to complete the transition effect. Syntax: Return the transitionDuration property:object.style.transitionDurationSet the transitionDuration:object.style.transitionDuration = "tim 1 min read HTML ondragstart Event Attribute HTML ondragstart Event Attribute is used when the user wants to drag the text or element. It is simply the process in which we press on the desired text to drag and drop them to a different location. Basically, it Initiates when the user starts dragging an element and is used to set data to be trans 3 min read HTML | DOM Style animationDelay Property The animationDelay Property in HTML DOM is used to set or returns the delay after which the animation should start. Syntax: It is used to set the animationDelay property:object.style.animationDelay = "time|initial|inherit"It is used to return the animationDelay property:object.style.animationDelay P 3 min read HTML | DOM Window parent Property HTML DOM Window parent Property returns the parent window of the current window. It is a read-only property. If a window does not have a parent, then it refers to itself. Syntax: window.parent Return Value: Parent Window object of current window. If there is no parent window then it refers to itself 1 min read HTML DOM isDefaultNamespace() Method The DOM isDefaultNamespace() method is used to return boolean true if the specified namespace is default otherwise, it returns boolean false. The URI of the namespace required can be checked using the namespaceURI string. Syntax:node.isDefaultNamespaceReturn Value: It returns a boolean value true if 1 min read HTML | DOM Style animationName Property The animationName Property in HTML DOM is used to set or returns a name for @keyframes animation. Syntax: It is used to set the animationName property:object.style.animationName = "none|keyframename|initial|inherit"It is used to return the animationName property:object.style.animationName Property V 3 min read HTML DOM Style transition Property The HTML DOM Style Property is used to change the appearance of any DIV element. It changes the appearance whenever the mouse hovers over that element. SyntaxFor return the transition property:object.style.transitionFor set the transition property:object.style.transition = "property duration timing 2 min read HTML | DOM Textarea maxlength Property The DOM Textarea maxlength Property is used to set or return the value of the maxlength attribute of a textarea field. It specifies the maximum number of characters that have been allowed in the Element. Syntax: It is used to return the maxLength property: textareaObject.maxLength It is used to set 2 min read HTML | DOM meter Object The DOM Meter Object is used to represent the HTML <meter> element. The meter element is accessed by getElementById().Properties: form: It belongs to one or more forms that it belongs too.max: It is used to specify the maximum value of a range.min: It is used to specify the minimum value of a 2 min read HTML | DOM Textarea placeholder Property The DOM Textarea placeHolder Property is used to set or return the value of the placeholder attribute of a textarea field. It specifies a short hint that describes the expected value of an input field / textarea. A short message or hint displayed before entering value in textarea. Syntax: It is used 2 min read Like