HTML DOM Input Color name Property Last Updated : 16 Jun, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report The DOM Input Color name Property in HTML DOM is used to set or return the value of the name attribute. The name attribute is required for each input color field. If the name attribute is not specified in an input field then the data of that field would not be sent at all. Syntax: It returns the Input Color name property.colorObject.nameIt is used to set the Input Color name property.colorObject.name = name Property Values: It contains a single property value i.e. name which is used to specify the name of the Color field. Return value: It returns a string value that represents the name of the input Color field. Example 1: This example returns the Input color name property. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Input Color name Property </title> </head> <body style="text-align:center;"> <h1> GeeksForGeeks </h1> <h2> HTML DOM Input Color name Property </h2> <p> Select your favorite color: <input type="color" value="#009900" name="Geek_color" id="color"> </p> <button onclick="myGeeks()"> Click Here! </button> <p id="GFG" style="color:green; font-size:24px;"> </p> <!-- script to return the name of input color field--> <script> function myGeeks() { let x = document.getElementById( "color").name; document.getElementById( "GFG").innerHTML = x; } </script> </body> </html> Output: Example 2: This Example illustrates how to set the name Property. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Input Color name Property </title> </head> <body style="text-align:center;"> <h1> GeeksForGeeks </h1> <h2> HTML DOM Input Color name Property </h2> <p> Select your favorite color: <input type="color" value="#009900" name="Geek_color" id="color"> </p> <button onclick="myGeeks()"> Click Here! </button> <p id="GFG" style="color:green; font-size:24px;"> </p> <!-- script to change the name of input color field --> <script> function myGeeks() { let x = document.getElementById( "color").name = "Hello Geeks"; document.getElementById( "GFG").innerHTML = "The value of the name attribute" + " was changed to " + x; } </script> </body> </html> Output: Supported Browsers: The browsers supported by DOM input color name property are listed below: Google Chrome 20Edge 14Firefox 29Opera 12Safari 12.1 Comment More infoAdvertise with us Next Article HTML DOM Input Image name 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 Color list Property The input color list property in HTML DOM is used to return a reference to the datalist element that contains an input color field. Syntax: colorObject.list.id Return Value: It returns a string value that represents the value of the id attribute of the datalist element. Example: Below HTML code is u 1 min read HTML | DOM Input Color form Property The DOM Input Color form Property in HTML DOM is used to return the reference to the form containing the input color picker field. It is read-only Property that returns a form object on success. Syntax: colorObject.form Return Values: It returns a string value which specify the reference of the form 1 min read HTML DOM Input Color type Property The DOM Input Color type Property in HTML DOM is used for returning which type of form element containing the color picker is. This property will always return "color". Syntax: colorObject.type Return Value: It returns a string value that represents the type of form element the input color field is. 1 min read HTML | DOM Input Color value Property The DOM Input Color value Property in HTML DOM is used to set or return the value of the value attribute of a color picker. The value attribute is used to specify the color for the color picker. It's default value is #000000 (black color). Syntax It returns the value property.colorObject.valueIt is 2 min read HTML DOM Input Image name Property The HTML DOM Input Image name Property is used for setting or returning the value of the name attribute of the Input Image. The name Attribute is used to reference the form-data after submitting the form or to reference the element in JavaScript. Syntax: To returns the name Property: imageObject.nam 2 min read HTML | DOM Input Range name Property The DOM Input Range NAME Property in HTML DOM is used to set or return the value of name attribute of a range field. The name attribute is required for each input field. If the name attribute is not specified in an input field then the data of that field would not be sent at all. Syntax: It returns 2 min read Like