एचटीएमएल डोम फॉर्म ऑब्जेक्ट
प्रपत्र वस्तु
प्रपत्र वस्तु एक HTML <form> तत्व का प्रतिनिधित्व करती है।
एक फॉर्म ऑब्जेक्ट तक पहुंचें
आप getElementById() का उपयोग करके <form> तत्व तक पहुंच सकते हैं:
उदाहरण
var x = document.getElementById("myForm");
युक्ति: आप प्रपत्र संग्रह का उपयोग करके <form> तत्व तक भी पहुंच सकते हैं ।
एक फॉर्म ऑब्जेक्ट बनाएं
आप document.createElement() विधि का उपयोग करके एक <form> तत्व बना सकते हैं:
उदाहरण
var x = document.createElement("FORM");
प्रपत्र वस्तु संग्रह
Collection | Description |
---|---|
elements | Returns a collection of all elements in a form |
प्रपत्र वस्तु गुण
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 |
फॉर्म ऑब्जेक्ट मेथड्स
Method | Description |
---|---|
reset() | Resets a form |
submit() | Submits a form |
मानक गुण और घटनाएँ
फॉर्म ऑब्जेक्ट मानक गुणों और घटनाओं का भी समर्थन करता है ।
संबंधित पृष्ठ
एचटीएमएल ट्यूटोरियल: एचटीएमएल फॉर्म
जावास्क्रिप्ट ट्यूटोरियल: जेएस फॉर्म/सत्यापन
एचटीएमएल संदर्भ: एचटीएमएल <फॉर्म> टैग