HTML DOM Giriş Düğmesi Nesnesi
Giriş Düğmesi Nesnesi
Input Button nesnesi, type="button" ile bir HTML <input> öğesini temsil eder.
Bir Giriş Düğmesi Nesnesine Erişme
getElementById() kullanarak type="button" ile bir <input> öğesine erişebilirsiniz:
Örnek
var x = document.getElementById("myBtn");
İpucu: Bir formun öğe koleksiyonunda arama yaparak da <input type="button"> öğesine erişebilirsiniz .
Bir Giriş Düğmesi Nesnesi Oluşturun
Document.createElement() yöntemini kullanarak type="button" ile bir <input> öğesi oluşturabilirsiniz:
Örnek
var x = document.createElement("INPUT");
x.setAttribute("type", "button");
Giriş Düğmesi Nesne Özellikleri
Property | Description |
---|---|
autofocus | Sets or returns whether an input button should automatically get focus when the page loads |
defaultValue | Sets or returns the default value of an input button |
disabled | Sets or returns whether an input button is disabled, or not |
form | Returns a reference to the form that contains the input button |
name | Sets or returns the value of the name attribute of an input button |
type | Returns which type of form element the input button is |
value | Sets or returns the value of the value attribute of an input button |
Standart Özellikler ve Olaylar
Giriş Düğmesi 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