The type
property returns type of the color picker.
For a color picker this property will always return "color".
type |
Yes | No | Yes | No | Yes |
var v = colorObject.type
A String type value representing the type of the color picker.
The following code shows how to get the type of the color picker.
<!DOCTYPE html>
<html>
<body>
<!--from ww w. j a va2 s. c o m-->
A color picker: <input type="color" id="myColor">
<button onclick="myFunction()">test</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myColor").type;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
The code above is rendered as follows: