Input Week autofocus Attribute

Definition and Usage

autofocus Attribute to set or return whether the week field should automatically gain focus when the page is loaded.

This property reflects the HTML autofocus attribute.

See also:

HTML Reference Manual:خصائص autofocus لـ <input> في HTML

Example

Check if the week field will automatically gain focus when the page is loaded:

var x = document.getElementById("myWeek").autofocus;

Try it yourself

Syntax

Return autofocus attribute:

weekObject.autofocus

Set autofocus attribute:

weekObject.autofocus = true|false

Attribute value

Value Description
true|false

Specify whether the week field should gain focus when the page is loaded.

  • true - The week field has gained focus
  • false - Default. The week field has not gained focus

تفاصيل التقنية

القيمة المعدة: قيمة بولية، إذا كان حقل الأسبوع في الصفحة يتم تحديده تلقائيًا عند تحميل الصفحة، يتم العودة true؛ إذا لم يكن كذلك، يتم العودة false.

دعم المتصفحات

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
دعم 10.0 دعم دعم دعم

ملاحظة:عنصر <input type="week"> لا يظهر أي حقل تاريخ أو تقويم في Firefox.