Skip to content
Related Articles

Related Articles

Improve Article
HTML | <input type=”color”>
  • Last Updated : 28 May, 2019

The HTML <input type=”color”> is used to define a color picker. the value should be a seven character hexadecimal notation. It has a Default value which is #000000(black).

Syntax:

<input type="color"> 

Example:




<!DOCTYPE html>
<html>
  
<head>
    <title>
        HTML DOM Input Type = "color"
    </title>
</head>
  
<body style="text-align:center;">
    <h1
        GeeksForGeeks 
    </h1>
    <h2
        HTML <input type="color> 
    </h2>
  
    <p>
        Select your favorite color:
        <input type="color" 
               value="#009900" 
               id="color">
    </p>
</body>
  
</html>

Output :

Supported Browsers:

  • Google Chrome 20.0
  • Firefox 29.0
  • Edge 38.0
  • Opera 11.1
  • Apple Safari 10.1
My Personal Notes arrow_drop_up
Recommended Articles
Page :