HTML DOM Input Color Object - W3Schools
Có thể bạn quan tâm
Input Color Object
The Input Color Object is new in HTML5.
The Input Color object represents an HTML <input> element with type="color".
Note: <input> elements with type="color" are not supported in Internet Explorer or Safari.
Access an Input Color Object
You can access an <input> element with type="color" by using getElementById():
var x = document.getElementById("myColor"); Try itTip: You can also access <input type="color"> by searching through the elements collection of a form.
Create an Input Color Object
You can create an <input> element with type="color" by using the document.createElement() method:
var x = document.createElement("INPUT");x.setAttribute("type", "color"); Try itInput Color Object Properties
Property | Description |
---|---|
autocomplete | Sets or returns the value of the autocomplete attribute of a color picker |
autofocus | Sets or returns whether a color picker should automatically get focus when the page loads |
defaultValue | Sets or returns the default value of a color picker |
disabled | Sets or returns whether a color picker is disabled, or not |
form | Returns a reference to the form that contains the color picker |
list | Returns a reference to the <datalist> element that contains the color picker |
name | Sets or returns the value of the name attribute of a color picker |
type | Returns which type of form element the color picker is |
value | Sets or returns the value of the value attribute of a color picker |
Standard Properties and Events
The Input Color object also supports the standard properties and events.
Related Pages
HTML tutorial: HTML Forms
HTML reference: HTML <input> tag
HTML reference: HTML <input> type attribute
« Previous Next Reference »Từ khóa » Html Color Input
-
- HTML: HyperText Markup Language | MDN"> - HTML: HyperText Markup Language | MDN
-
HTML Input Type="color" - W3Schools
-
Input Type Color - With Color Picker - Tryit Editor V3.7
-
HTML Input Type="color" Attribute - Dofactory
-
- GeeksforGeeks">HTML | - GeeksforGeeks
-
How To Add A Color Picker In HTML
-
Color Input Type | Can I Use... Support Tables For HTML5, CSS3, Etc
-
How To Style Color Picker Window In An Input[type=color]?
-
Color Picker - HTML Color Codes
-
Color Type - HTML5 Forms - Wufoo
-
- CodeProject Reference">Html - CodeProject Reference
-
Input[type="color"] Element (html)
-
How To Use Input Type Field With The Color Picker In HTML?