Input DatetimeLocal nameProperty

Input DatetimeLocal 对象参考手册Input DatetimeLocal Object

Example

Get the name of the local datetime field:

var x = document.getElementById("myLocalDate").name;
xThe output result is:
bdaytime

Try it yourself »

Definition and Usage

The name property is used to set or return the value of the name attribute of the local datetime field.

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

Note:Only when the name attribute is set can data be submitted to the server after form submission.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All mainstream browsers support the name attribute.

Note:Internet Explorer or Firefox browsers do not support the <input type="datetime-local"> element.


Syntax

Return the name attribute:

datetimelocalObject.name

Set the name attribute:

datetimelocalObject.name=name

Property Values

Value Description
name Describes the name of the local datetime field.

Technical Details

Return value: A string representing the name of the local datetime field.


More Examples

Example

Modify the name of the local datetime field:

document.getElementById("myLocalDate").name = "newDatetimeName";

Try it yourself »


Related Pages

HTML Reference Manual:HTML <input> name Attribute


Input DatetimeLocal 对象参考手册Input DatetimeLocal Object Other Extensions