HTML DOM Girişi Renk Nesnesi
Giriş Rengi Nesnesi
Input Color nesnesi, type="color" ile bir HTML <input> öğesini temsil eder.
Not: <input type="color">, IE 11 ve önceki sürümlerde veya Safari 9.1 ve önceki sürümlerde desteklenmez.
Bir Girdi Rengi Nesnesine Erişme
getElementById() kullanarak type="color" ile bir <input> öğesine erişebilirsiniz:
Örnek
var x = document.getElementById("myColor");
İpucu: Bir formun öğe koleksiyonunda arama yaparak da <input type="color"> öğesine erişebilirsiniz .
Bir Girdi Rengi Nesnesi Oluşturun
Document.createElement() yöntemini kullanarak type="color" ile bir <input> öğesi oluşturabilirsiniz:
Örnek
var x = document.createElement("INPUT");
x.setAttribute("type", "color");
Giriş Rengi Nesne Özellikleri
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 |
Standart Özellikler ve Olaylar
Input Color nesnesi ayrıca standart özellikleri ve olayları da destekler .
İlgili Sayfalar
HTML öğreticisi: HTML Formları
HTML referansı: HTML <input> etiketi
HTML referansı: HTML <input> tipi özniteliği