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:
HTML
<!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 and above
- Firefox 29.0 and above
- Edge 14 and above
- Opera 12 and above
- Apple Safari 12.1 and above
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
02 Jun, 2022
Like Article
Save Article