WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

HTML DOM Input Color Object

Input Color Object

The Input Color Object is new in HTML5.

The Input Color object speaks to a HTML <input> component with type="color".

Note: <input> components with type="color" are not upheld in Web Explorer or Safari.

Access an Input Color Object

You can get to a <input> component with type="color" by utilizing getElementById():

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

Tip: You can likewise get to <input type="color"> via seeking through the elements gathering of a form.

Create an Input Color Object

You can make a <input> component with type="color" by utilizing the document.createElement() method:

var x = document.createElement("INPUT");
x.setAttribute("type", "color");

Input Color Object Properties

Property Description
autocomplete Sets or returns the estimation of the autocomplete trait of a shading picker
autofocus Sets or returns whether a shading picker ought to naturally get center at the point when the page loads
defaultValue Sets or returns the default estimation of a shading picker
disabled Sets or returns whether a shading picker is debilitated, or not
form Returns a reference to the structure that contains the shading picker
list Returns a reference to the <datalist> component that contains the shading picker
name Sets or returns the estimation of the name property of a shading picker
type Returns which sort of structure component the shading picker is
value Sets or returns the estimation of the esteem trait of a shading picker

Input Color Object

The Input Color Object is new in HTML5.

The Input Color object speaks to a HTML <input> component with type="color".

Note: <input> components with type="color" are not bolstered in Web Explorer or Safari.

Access an Input Color Object

You can get to a <input> component with type="color" by utilizing getElementById():

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

Tip: You can likewise get to <input type="color"> via looking through the elements accumulation of a form.

Create an Input Color Object

You can make a <input> component with type="color" by utilizing the document.createElement() method:

var x = document.createElement("INPUT");
x.setAttribute("type", "color");

Input Color Object Properties

Property Description
autocomplete Sets or returns the estimation of the autocomplete quality of a shading picker
autofocus Sets or returns whether a shading picker ought to naturally get center at the point when the page loads
defaultValue Sets or returns the default estimation of a shading picker
disabled Sets or returns whether a shading picker is incapacitated, or not
form Returns a reference to the structure that contains the shading picker
list Returns a reference to the <datalist> component that contains the shading picker
name Sets or returns the estimation of the name characteristic of a shading picker
type Returns which sort of structure component the shading picker is
value Sets or returns the estimation of the esteem characteristic of a shading picker