HTML5 INPUT color

From CoderLearner
Jump to: navigation, search

Description

This color type is used for the input field that contains a color.

Note

Browser Support: Chrome and Opera

Example 1


<!DOCTYPE html>
<html>
   <head>
      <title>Color</title>
   </head>
   <body>
      <form action="form_color_ss.php">
        Color: <input type="color" name="mycolor">
         <input type="submit">
      </form>
   </body>
</html>

form_color_ss.php

<?php
if ($_REQUEST) {
   echo 'selected color: ' . $_REQUEST['mycolor'];
} else {
   echo 'error';
}
?>

Try It