एचटीएमएल डोम बटन वस्तु
बटन वस्तु
बटन ऑब्जेक्ट एक HTML <बटन> तत्व का प्रतिनिधित्व करता है।
एक बटन वस्तु तक पहुँचें
आप getElementById() का उपयोग करके <button> तत्व तक पहुंच सकते हैं:
उदाहरण
var x = document.getElementById("myBtn");
एक बटन वस्तु बनाएँ
आप document.createElement() विधि का उपयोग करके <button> तत्व बना सकते हैं:
उदाहरण
var x = document.createElement("BUTTON");
बटन वस्तु गुण
Property | Description |
---|---|
autofocus | Sets or returns whether a button should automatically get focus when the page loads, or not |
disabled | Sets or returns whether a button is disabled, or not |
form | Returns a reference to the form that contains a button |
formAction | Sets or returns the value of the formaction attribute of a button |
formEnctype | Sets or returns the value of the formenctype attribute of a button |
formMethod | Sets or returns the value of the formmethod attribute of a button |
formNoValidate | Sets or returns whether the form-data should be validated or not, on submission |
formTarget | Sets or returns the value of the formtarget attribute of a button |
name | Sets or returns the value of the name attribute of a button |
type | Sets or returns the type of a button |
value | Sets or returns the value of the value attribute of a button |
मानक गुण और घटनाएँ
बटन ऑब्जेक्ट मानक गुणों और घटनाओं का भी समर्थन करता है ।
संबंधित पृष्ठ
HTML संदर्भ: HTML <बटन> टैग