HTML DOM Input Color defaultValue Property Last Updated : 16 Jun, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report The DOM Input Color defaultValue Property in HTML DOM is used to set or return the default value of a Color picker. It is the value specified in the value attribute. Syntax: It returns the defaultValue property.colorObject.defaultValueIt is used to set the defaultValue property.colorObject.defaultValue = value Property Values: value: It specifies the default value of the Color picker. Return Value: It returns the value of the color picker in the form of a string. Example 1: This example returns the defaultValue of the Input Color property. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Input Color defaultValue Property </title> </head> <body style="text-align:center;"> <h1> GeeksForGeeks </h1> <h2> HTML DOM Input Color defaultValue Property </h2> <form id="myGeeks"> <label> Select your favorite color: </label> <input type="color" value="#009900" name="Geek_color" id="color" disabled> </form> <button onclick="myGeeks()"> Click Here! </button> <p id="GFG" style="color:green; font-size:24px;"> </p> <script> function myGeeks() { let x = document.getElementById( "color").defaultValue; document.getElementById( "GFG").innerHTML = x; } </script> </body> </html> Output: Example 2: This Property illustrates how to set the Property. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Input Color defaultValue Property </title> </head> <body style="text-align:center;"> <h1> GeeksForGeeks </h1> <h2> HTML DOM Input Color defaultValue Property </h2> <form id="myGeeks"> <label> Select your favorite color: </label> <input type="color" value="#009900" name="Geek_color" id="color" disabled> </form> <button onclick="myGeeks()"> Click Here! </button> <p id="GFG" style="color:green; font-size:24px;"> </p> <script> function myGeeks() { let x = document.getElementById( "color").defaultValue = "#ff0080"; document.getElementById( "GFG").innerHTML = "The default value was changed to " + x; } </script> </body> </html> Output: Supported Browsers: The browsers supported by DOM input color defaultValue property are listed below: Google Chrome 20Edge 14Firefox 29Opera 12Safari 12.1 Comment More infoAdvertise with us Next Article HTML | DOM Input Checkbox defaultValue Property M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML Web technologies HTML-DOM HTML-Property +2 More Practice Tags : Misc Similar Reads HTML | DOM Input Checkbox defaultValue Property The DOM Input Checkbox defaultValue Property is used to set or returns the default value of an Input Checkbox field. This property is used to reflect the HTML value attribute. The main difference between the default value and value is that the default value indicates the default value and the value 2 min read HTML | DOM Input Date defaultValue Property The Input Date defaultValue Property in HTML DOM is used to set or return the default value of a date field. This property is used to reflect the HTML value attribute. The main difference between the default value and value is that the default value indicate the default value and the value contains 2 min read HTML | DOM Input URL defaultValue Property The DOM Input URL defaultValue Property in HTML DOM is used to set or return the default value of the URL Field. This property is used to reflect the HTML value attribute. The main difference between the default value and value is that the default value indicates the default value and the value cont 2 min read HTML DOM Input Tel defaultValue Property The Input Tel defaultValue property in HTML DOM is used to set or return the default value of the input tel field. This property is used to reflect the HTML value attribute. The main difference between the default value and value is that the default value indicates the default value and the value co 2 min read HTML DOM Input Text defaultValue Property The Input Text defaultValue Property in HTML DOM is used to set or return the default value of the Text Field. This property is used to reflect the HTML value attribute. The main difference between the default value and value is that the default value indicate the default value and the value contain 2 min read HTML | DOM Input Time defaultValue Property The DOM Input Time defaultValue Property in HTML DOM is used to set or return the default value of the Time Field. This property is used to reflect the HTML value attribute. The main difference between the default value and value is that the default value indicates the default value and the value co 2 min read Like