HTML5 input color's default color
colors, html, input
Solution
While using hexcode for `value` attribute in `<input type="color">`, one thing I noticed is that it has to be six digits, if for white you use `#fff`, it does not work. It has to be `#ffffff`.
The same thing happens when setting it through javascript. `document.querySelector('input[type="color"]').value = '#fff'` does not work. The color remains black. You have to use `document.querySelector('input[type="color"]').value = '#ffffff'` for it to work.
Something to be careful about.
Problem
The `input type="color"` has a default color which is black: `#000000`. Even if I give it an empty value... `<input type="color" value="" />` ...the default color is always black. I want the user to have the option of picking a color, but if he doesn't it means no color was picked, not even white `#FFFFFF`. Is there a way to force an `input type="color"` not to have black color as default? I can use some kind of a "listener" to check if the user changed the color for the first time, if not, ignore the value, but I would like to avoid Javascript.