Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Input Time name property

Input Time name property

Input Time Object Reference Input Time Object

Example

Get the name of the time field:

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

x

The output is:

usr_time

Try it »


Definition and Usage

The name property sets or returns the value of the name attribute of the time field.

The name attribute is typically used as the identifier for submitting form data to the server, or as a reference identifier for JavaScript on the client side.

Note: Data can only be submitted to the server after the form is submitted if the name attribute is set.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the name attribute.

Note: Internet Explorer or Firefox browsers do not support HTML using the type="time" attribute .


Syntax

Return the name attribute:

timeObject

.name

Set the name attribute:

timeObject

.name=

name

Attribute values

Value Description
name Describes the name of the time field

Technical Details

Return Value: String, representing the name of the time field

More examples

Example

Modify the name of the time field:

document.getElementById("myTime").name = "newTimeName";

Try it »


Related pages

HTML Reference Manual: HTML name attribute


Input Time Object Reference Input Time Object