jump

HTML 5: The Markup Language (ARIA Edition)

input type=timetime input control NEW # T

The input element with a type attribute whose value is "time" represents a control for setting the element’s value to a string representing a time (with no timezone information).

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = d:string "disabled" or d:string "" #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = d:string "time" #
Specifies that its input element is a control for setting the element’s value to a string representing a time.
autocomplete = d:string "on" or d:string "off" NEW #
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later).
autofocus = d:string "autofocus" or d:string "" NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
list = ID reference NEW #
The value of the id attribute on the datalist with which to associate the element.
min = time NEW #
The expected lower bound for the element’s value.
A valid partial-time as defined in [RFC 3339].

Examples:

23:20:50.52
17:39:57
max = time NEW #
The expected upper bound for the element’s value.
A valid partial-time as defined in [RFC 3339].

Examples:

23:20:50.52
17:39:57
step = d:string "any" or positive floating-point number NEW #
Specifies the value granularity of the element’s value.
readonly = d:string "readonly" or d:string "" #
Specifies that element represents a control whose value is not meant to be edited.
required = d:string "required" or d:string "" NEW #
Specifies that the element is a required part of form submission.
value = time #
A string representing a time (with no timezone information).
A valid partial-time as defined in [RFC 3339].

Examples:

23:20:50.52
17:39:57

Additional constraints and admonitions #

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement? form;
  readonly attribute FileList? files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute unsigned long height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement? list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date? valueAsDate;
           attribute double valueAsNumber;
           attribute unsigned long width;

  void stepUp(optional long n);
  void stepDown(optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
           attribute DOMString selectionDirection;
  void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction);
};