HTML DOM इनपुट चेकबॉक्स ऑब्जेक्ट
इनपुट चेकबॉक्स ऑब्जेक्ट
इनपुट चेकबॉक्स ऑब्जेक्ट एक HTML <इनपुट> तत्व का प्रतिनिधित्व करता है जिसमें टाइप = "चेकबॉक्स" होता है।
एक इनपुट चेकबॉक्स ऑब्जेक्ट तक पहुंचें
आप getElementById() का उपयोग करके टाइप = "चेकबॉक्स" के साथ <इनपुट> तत्व तक पहुंच सकते हैं:
उदाहरण
var x = document.getElementById("myCheck");
युक्ति: आप किसी प्रपत्र के तत्वों के संग्रह के माध्यम से खोज कर <इनपुट प्रकार = "चेकबॉक्स"> तक भी पहुंच सकते हैं ।
एक इनपुट चेकबॉक्स ऑब्जेक्ट बनाएं
आप document.createElement() विधि का उपयोग करके टाइप = "चेकबॉक्स" के साथ एक <इनपुट> तत्व बना सकते हैं:
उदाहरण
var x = document.createElement("INPUT");
x.setAttribute("type", "checkbox");
इनपुट चेकबॉक्स वस्तु गुण
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 |
मानक गुण और घटनाएँ
इनपुट चेकबॉक्स ऑब्जेक्ट मानक गुणों और घटनाओं का भी समर्थन करता है ।
संबंधित पृष्ठ
एचटीएमएल ट्यूटोरियल: एचटीएमएल फॉर्म
HTML संदर्भ: HTML <इनपुट> टैग
HTML संदर्भ: HTML <इनपुट> प्रकार विशेषता