Input Date nameProperty

Input Date 对象参考手册Input Date Object

Example

Get the name of the date field:

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

Try it Yourself »

Definition and Usage

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

The name property 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:Data can only be submitted to the server if the name attribute is set.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the name property

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


Syntax

Return the name property:

inputdateObject.name

Set the name property:

inputdateObject.name=name

Property Values

Value Description
name Describes the name of the date field

Technical Details

Return value: A string, representing the name of the date field.


More Examples

Example

Change the name of the date field:

document.getElementById("myDate").name = "newDateName";

Try it Yourself »


Related Pages

HTML Reference:HTML <input> name Attribute


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