Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Input Color type attribute

Input Color type attribute

Input Color Object Reference Input Color Object

Example

Return the form element type of the color picker:

var x = document.getElementById("myColor").type;

x

The output is:

color

Try it »


Definition and Usage

The type attribute is used to return the form element type of the color picker.

The form of the color picker usually returns "color".


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the type attribute.

**Note:** Internet Explorer and Safari browsers do not support .


Syntax

colorObject

.type

Technical Details

Return Value: A string representing the form type of the color picker.

Input Color Object Reference Input Color Object