HTML DOM Girişi Onay Kutusu Nesnesi
Giriş Onay Kutusu Nesnesi
Giriş Onay Kutusu nesnesi, type="checkbox" ile bir HTML <input> öğesini temsil eder.
Bir Giriş Onay Kutusu Nesnesine Erişme
getElementById() kullanarak type="checkbox" ile bir <input> öğesine erişebilirsiniz:
Örnek
var x = document.getElementById("myCheck");
İpucu: Bir formun öğe koleksiyonunda arama yaparak da <input type="checkbox"> öğesine erişebilirsiniz .
Bir Giriş Onay Kutusu Nesnesi Oluşturun
Document.createElement() yöntemini kullanarak type="checkbox" ile bir <input> öğesi oluşturabilirsiniz:
Örnek
var x = document.createElement("INPUT");
x.setAttribute("type", "checkbox");
Giriş Onay Kutusu Nesne Özellikleri
Property | Description |
---|---|
autofocus | Sets or returns whether a checkbox should automatically get focus when the page loads |
checked | Sets or returns the checked state of a checkbox |
defaultChecked | Returns the default value of the checked attribute |
defaultValue | Sets or returns the default value of a checkbox |
disabled | Sets or returns whether a checkbox is disabled, or not |
form | Returns a reference to the form that contains the checkbox |
indeterminate | Sets or returns the indeterminate state of the checkbox |
name | Sets or returns the value of the name attribute of a checkbox |
required | Sets or returns whether the checkbox must be checked before submitting a form |
type | Returns which type of form element the checkbox is |
value | Sets or returns the value of the value attribute of a checkbox |
Standart Özellikler ve Olaylar
Giriş Onay Kutusu nesnesi, standart özellikleri ve olayları da destekler .
İlgili Sayfalar
HTML öğreticisi: HTML Formları
HTML referansı: HTML <input> etiketi
HTML referansı: HTML <input> tipi özniteliği