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

HTML DOM Input Date name attribute

Input Date name attribute

Input Date Object Reference Input Date Object

Example

Get the name of the date field:

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

x

The output is:

bday

Try it »


Definition and Usage

The name attribute sets or returns the value of the date field's name attribute

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 if the name attribute is set.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the name attribute

**Note:** Internet Explorer or Firefox browser does not support .


Syntax

Return the name attribute:

inputdateObject

.name

Set the name attribute:

inputdateObject

.name=

name

Attribute 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

Modify the name of the date field:

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

Try it »


Related pages

HTML Reference Manual: HTML name attribute


Input Date Object Reference Input Date Object