YouTip LogoYouTip

Prop Input Time Autofocus

HTML DOM Input Time autofocus Property

HTML DOM Input Time autofocus Property

-- Learning is not just about technology, but also about dreams!

JavaScript Reference Manual

Overview

JavaScript Objects

JavaScript Array Object JavaScript Boolean Object JavaScript Date Object JavaScript Math Object JavaScript Number Object JavaScript String Object JavaScript RegExp Object JavaScript Global Properties/Functions JavaScript Operators JavaScript Error

Browser Objects

Window Object Navigator Object Screen Object History Object Location Object Storage Object

DOM Objects

HTML DOM Document Object HTML DOM Element Object HTML DOM Attribute Object HTML DOM Event Object HTML DOM Console Object CSSStyleDeclaration Object DOM HTMLCollection

HTML Objects

<a> <area> <audio> <base> <blockquote> <body> <button> <canvas> <col> <colgroup> <datalist> <del> <details> <dialog> <embed> <fieldset> <form> <iframe> <frameset > <img> <ins> <input> - button <input> - checkbox <input> - color <input> - date <input> - datetime <input> - datetime-local <input> - email <input> - file <input> - hidden <input> - image <input> - month <input> - number <input> - range <input> - password <input> - radio <input> - reset <input> - search <input> - submit <input> - text <input> - time <input> - url <input> - week <keygen> <link> <label> <legend> <li> <map> <menu> <menuItem> <meta> <meter> <object> <ol> <optgroup> <option> <param> <progress> <q> <script> <select> <source> <style> <table> <td> <th> <tr> <textarea> <title> <time> <track> <video>

HTML DOM Input Text Object

<input> - url

Input Time autofocus Property

Input Time Object Reference Manual Input Time Object

Example

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

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

The output of x is:

true

Try it yourself Β»


Definition and Usage

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

The property reflects the HTML autofocus attribute.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

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 HTML <input> element with the type="time" attribute.


Syntax

Return the autofocus property:

timeObject.autofocus

Set the autofocus property:

timeObject.autofocus=true|false

Property Values

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

Technical Details

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

Related Pages

HTML Reference Manual: HTML <input> autofocus Attribute


Input Time Object Reference Manual Input Time Object

HTML DOM Input Text Object

<input> - url

ByteDance Coding Plan supports mainstream large models like Doubao, GLM, DeepSeek, Kimi, MiniMax, etc., officially supplied, stable and reliable. Configuration Guide Β₯9.9/month Subscribe Now

← Prop Input Time DisabledProp Input Time Form β†’