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