The HTML <input type="color"> element is used to create a color picker input field in a form. It allows users to select a color using a graphical color selection interface.
- Used to select colors from a color picker
- Created using <input type="color"> inside a form
- Supports attributes like value, disabled, and name
Syntax:
<input type="color"> Example: Demonstrate the use of <input type="color">.
<!DOCTYPE html>
<html>
<head>
<title>
HTML Input Type Color
</title>
</head>
<body style="text-align:center;">
<h2>HTML <input type="color"></h2>
<form action="#">
<label for="color">Select Color:</label>
<input type="color" value="#009900" id="color">
</form>
</body>
</html>