How to use input type field with the color picker in HTML?

HTMLWeb DevelopmentFront End Technology

The <input type="color"> is for input fields with color. It will allow you to select a color from color picker.

A color picker will be visible when you will click on the default color box. Here, you can set the default color also with the value attribute −


You can try to run the following code to show a color picker with input type color −

<!DOCTYPE html>
      <title>HTML input color</title>
      <form action = "" method = "get">
         Select which color you want for your website:<br><br>
         <input type="color" name="favcolor" value="#FFFFF"><br>
         <input type="submit" value="submit">
Published on 23-Jan-2018 14:55:42