Skip to content
Related Articles

Related Articles

HTML | DOM Input Color type Property

View Discussion
Improve Article
Save Article
  • Difficulty Level : Basic
  • Last Updated : 22 Jun, 2021

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”. 


Return Value: It returns a string value that represents the type of form element the input color field  is.

Below Program illustrates the use of Input Color type Property.


<!DOCTYPE html>
        HTML DOM Input Color type Property
<body style="text-align:center;">
        HTML DOM Input Color type Property
        Select your favorite color:
        <input type="color"
    <button onclick="myGeeks()">
        Click Here!
    <p id="GFG"
    <!-- script to return
     the input color -->
        function myGeeks() {
            var x =
              "GFG").innerHTML = x;

Output: Before Clicking On Button: 

After Clicking On Button: 

Supported Browsers: The browser supported by DOM input color type property listed below: 

  • Google Chrome
  • Internet Explorer 10.0 +
  • Firefox
  • Opera
  • Safari

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!