The input type=\"color\"
has a default color which is black: #000000
.
Even if I give it an empty value...
Don't know if this issue is only available on chrome, but I just found the quick fix for chrome. We need to set the input value to #FFFFFF first and after that set it to default value, the default color will appear instead of black
var element = document.querySelector('input[type="color"]');
element.value = '#FFFFFF'; //remember the hex value must has 7 characters
element.value = element.defaultValue;
Hope it help someone :)