Easy Tutorial
❮ Prop Audio Duration Met Node Issamenode ❯

HTML DOM Input Color Object


Input Color Object

The Input Color object represents an HTML <input> element with the type="color" attribute.

Note: Internet Explorer or Safari browsers do not support the <input> element with the type="color" attribute.

Accessing the Input Color Object

You can use the getElementById() function to access an <input> element with the type="color" attribute:

Tip: You can also access the Input Color object through the form's elements collection.

Creating an Input Color Object

You can use the document.createElement() method to create an <input> element with the type="color" attribute:

Input Color Object Properties

Property Description
autocomplete Sets or returns the autocomplete attribute value of the color picker.
autofocus Sets or returns whether the color picker should get focus when the page loads.
defaultValue Sets or returns the default value of the color picker.
disabled Sets or returns whether the color picker is disabled.
form Returns a reference to the form that contains the color picker.
list Returns a reference to the datalist that contains the color picker.
name Sets or returns the name attribute value of the color picker.
type Returns the type of the form element for the color picker.
value Sets or returns the value attribute value of the color picker.

Standard Properties and Events

The Input Color object also supports standard properties and events.


Related Articles

HTML Tutorial: HTML Forms

HTML Reference: HTML <input> Tag

HTML Reference: HTML <input> type Attribute

❮ Prop Audio Duration Met Node Issamenode ❯