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