HTML DOM Form Nesnesi
Form Nesnesi
Form nesnesi bir HTML <form> öğesini temsil eder.
Bir Form Nesnesine Erişme
Bir <form> öğesine getElementById() kullanarak erişebilirsiniz:
Örnek
var x = document.getElementById("myForm");
İpucu: Form koleksiyonunu kullanarak bir <form> öğesine de erişebilirsiniz .
Form Nesnesi Oluşturun
Document.createElement() yöntemini kullanarak bir <form> öğesi oluşturabilirsiniz:
Örnek
var x = document.createElement("FORM");
Form Nesnesi Koleksiyonları
Collection | Description |
---|---|
elements | Returns a collection of all elements in a form |
Form Nesnesi Özellikleri
Property | Description |
---|---|
acceptCharset | Sets or returns the value of the accept-charset attribute in a form |
action | Sets or returns the value of the action attribute in a form |
autocomplete | Sets or returns the value of the autocomplete attribute in a form |
encoding | Alias of enctype |
enctype | Sets or returns the value of the enctype attribute in a form |
length | Returns the number of elements in a form |
method | Sets or returns the value of the method attribute in a form |
name | Sets or returns the value of the name attribute in a form |
noValidate | Sets or returns whether the form-data should be validated or not, on submission |
target | Sets or returns the value of the target attribute in a form |
Form Nesnesi Yöntemleri
Method | Description |
---|---|
reset() | Resets a form |
submit() | Submits a form |
Standart Özellikler ve Olaylar
Form nesnesi ayrıca standart özellikleri ve olayları da destekler .
İlgili Sayfalar
HTML öğreticisi: HTML Formları
JavaScript eğitimi: JS Formları/Doğrulama
HTML referansı: HTML <form> etiketi