YouTip LogoYouTip

Prop Week Autofocus

HTML DOM Input Week autofocus Property

HTML DOM Input Week autofocus Property

HTML DOM Input Week autofocus Property

-- Learning not just technology, but dreams!

JavaScript Reference Manual

Overview

JavaScript Objects

Browser Objects

DOM Objects

HTML Objects

<input> - url

<keygen>

Deep Dive

  • Web Service
  • Network Service
  • Software
  • Script
  • Web Design and Development
  • Scripting Language
  • Programming
  • Computer Science
  • Development Tools
  • Programming Language

Input Week autofocus Property

Input Week Object Reference Manual Input Week Object

Example

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

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

x output result is:

true

Try it yourself Β»


Definition and Usage

The autofocus property is used to set or return whether the week field should automatically get focus when the page loads.

This property reflects the HTML autofocus attribute.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the autofocus property.

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

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

Property Values

Value Description
true|false Specifies whether the week field should get focus when 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 when the page loads, otherwise returns false.

Related Pages

HTML Reference Manual: HTML <input> autofocus Attribute


Input Week Object Reference Manual Input Week Object

← Prop Week DisabledProp Week Autofocus β†’