كائن تسمية DOM HTML
كائن التسمية
يمثل كائن Label عنصر HTML <label>.
الوصول إلى كائن التسمية
يمكنك الوصول إلى عنصر <label> باستخدام getElementById ():
مثال
var x = document.getElementById("myLabel");
قم بإنشاء كائن تسمية
يمكنك إنشاء عنصر <label> باستخدام طريقة 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 |
الخصائص القياسية والأحداث
يدعم كائن Label أيضًا الخصائص والأحداث القياسية .
الصفحات ذات الصلة
دروس HTML: نماذج HTML
مرجع HTML: علامة <label> HTML