Input Time name Attribute
Definition and Usage
name
Sets or returns the value of the name attribute of the time field.
The HTML name attribute is used to identify form data after form data is submitted to the server, or to reference form data on the client using JavaScript.
Note:Only form elements with a name attribute will pass their values when submitting a form.
See also:
HTML Reference Manual:HTML <input> name Attribute
Example
Example 1
Get the name of the time field:
var x = document.getElementById("myTime").name;
Example 2
Change the name of the time field:
document.getElementById("myTime").name = "newTimeName";
Syntax
Return the name property:
timeObject.name
Set the name property:
timeObject.name = name
Attribute Value
Value | Description |
---|---|
name | Specifies the name of the time field. |
Technical Details
Return Value: | A string value representing the name of the time field. |
---|
Browser Support
The numbers in the table indicate the first browser version that fully supports this attribute.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 10.0 | Support | Support | Support |
Note:The <input type="time"> element does not display as any time field in Firefox.