HTML DOM इनपुट रेंज ऑब्जेक्ट
इनपुट रेंज ऑब्जेक्ट
इनपुट रेंज ऑब्जेक्ट एक HTML <इनपुट> तत्व का प्रतिनिधित्व करता है जिसमें टाइप = "रेंज" होता है।
एक इनपुट रेंज ऑब्जेक्ट तक पहुंचें
आप getElementById() का उपयोग करके टाइप = "रेंज" के साथ <इनपुट> तत्व तक पहुंच सकते हैं:
उदाहरण
var x = document.getElementById("myRange");
युक्ति: आप किसी प्रपत्र के तत्वों के संग्रह के माध्यम से खोज कर <input type="range"> तक भी पहुंच सकते हैं ।
एक इनपुट रेंज ऑब्जेक्ट बनाएं
आप document.createElement() विधि का उपयोग करके टाइप = "रेंज" के साथ एक <इनपुट> तत्व बना सकते हैं:
उदाहरण
var x = document.createElement("INPUT");
x.setAttribute("type", "range");
इनपुट रेंज वस्तु गुण
Property | Description |
---|---|
autocomplete | Sets or returns the value of the autocomplete attribute of a slider control |
autofocus | Sets or returns whether a slider control should automatically get focus when the page loads |
defaultValue | Sets or returns the default value of a slider control |
disabled | Sets or returns whether a slider control is disabled, or not |
form | Returns a reference to the form that contains the slider control |
list | Returns a reference to the datalist that contains the slider control |
max | Sets or returns the value of the max attribute of the slider control |
min | Sets or returns the value of the min attribute of the slider control |
name | Sets or returns the value of the name attribute of a slider control |
step | Sets or returns the value of the step attribute of the slider control |
type | Returns which type of form element the slider control is |
value | Sets or returns the value of the value attribute of a slider control |
इनपुट रेंज ऑब्जेक्ट मेथड्स
Method | Description |
---|---|
stepDown() | Decrements the value of the slider control by a specified number |
stepUp() | Increments the value of the slider control by a specified number |
मानक गुण और घटनाएँ
इनपुट रेंज ऑब्जेक्ट मानक गुणों और घटनाओं का भी समर्थन करता है ।
संबंधित पृष्ठ
एचटीएमएल ट्यूटोरियल: एचटीएमएल फॉर्म
HTML संदर्भ: HTML <इनपुट> टैग
HTML संदर्भ: HTML <इनपुट> प्रकार विशेषता