एचटीएमएल डोम लेबल वस्तु
लेबल वस्तु
लेबल ऑब्जेक्ट एक HTML <लेबल> तत्व का प्रतिनिधित्व करता है।
एक लेबल वस्तु तक पहुँचें
आप getElementById() का उपयोग करके <लेबल> तत्व तक पहुंच सकते हैं:
उदाहरण
var x = document.getElementById("myLabel");
एक लेबल वस्तु बनाएँ
आप document.createElement() विधि का उपयोग करके <लेबल> तत्व बना सकते हैं:
उदाहरण
var x = document.createElement("LABEL");
लेबल वस्तु गुण
Property | Description |
---|---|
control | Returns the labeled control |
form | Returns a reference to the form that contains the label |
htmlFor | Sets or returns the value of the for attribute of a label |
मानक गुण और घटनाएँ
लेबल ऑब्जेक्ट मानक गुणों और घटनाओं का भी समर्थन करता है ।
संबंधित पृष्ठ
एचटीएमएल ट्यूटोरियल: एचटीएमएल फॉर्म
HTML संदर्भ: HTML <लेबल> टैग