Input Week autofocusProperty

Input Week 对象参考手册Input Week Object

Examples

Check whether the week field automatically gets focus after the page loads:

var x = document.getElementById("myWeek").autofocus;
xThe output result is:
true

Try it Yourself »

Definition and Usage

The autofocus property is used to set or return whether the week field automatically gets focus after the page loads.

This property reflects the HTML autofocus attribute.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the autofocus attribute

Note:Internet Explorer 9 and earlier IE versions, or Opera 12 and earlier Opera versions, do not support the autofocus attribute.

Note:Internet Explorer or Firefox browsers do not support the <input type="week"> element.


Syntax

Return the autofocus property:

weekObject.autofocus

Set the autofocus property:

weekObject.autofocus=true|false

Attribute Values

Value Description
true|false Describes whether the week field gets focus after the page loads
  • true - The week field gets focus
  • false - Default. The week field does not get focus

Technical Details

Return Value: A Boolean value, returns true if the week field automatically gets focus after the page loads, otherwise returns false.


Related Pages

HTML Reference Manual:HTML <input> autofocus Attribute


Input Week 对象参考手册Input Week Object Other Extensions