HTML DOM إدخال كائن مخفي
إدخال كائن مخفي
يمثل الكائن المخفي الإدخال عنصر <input> HTML مع النوع = "مخفي".
الوصول إلى إدخال كائن مخفي
يمكنك الوصول إلى عنصر <input> من خلال النوع = "مخفي" باستخدام getElementById ():
مثال
var x = document.getElementById("myInput");
نصيحة: يمكنك أيضًا الوصول إلى <input type = "hidden"> من خلال البحث في مجموعة عناصر النموذج.
إنشاء إدخال كائن مخفي
يمكنك إنشاء عنصر <input> بالنوع = "مخفي" باستخدام طريقة document.createElement ():
مثال
var x = document.createElement("INPUT");
x.setAttribute("type", "hidden");
إدخال خصائص الكائن المخفي
Property | Description |
---|---|
defaultValue | Sets or returns the default value of the hidden input field |
form | Returns a reference to the form that contains the hidden input field |
name | Sets or returns the value of the name attribute of the hidden input field |
type | Returns which type of form element a hidden input field is |
value | Sets or returns the value of the value attribute of the hidden input field |
الخصائص القياسية والأحداث
يدعم كائن Input Hidden أيضًا الخصائص والأحداث القياسية .
الصفحات ذات الصلة
دروس HTML: نماذج HTML
مرجع HTML: علامة <input> HTML
مرجع HTML: سمة نوع <إدخال> HTML