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

HTML DOM Input DatetimeLocal name attribute

Input DatetimeLocal name attribute

Input DatetimeLocal Object Reference Input DatetimeLocal Object

Example

Get the name of the local datetime field:

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

x

The output is:

bdaytime

Try it »


Definition and Usage

The name attribute is used to set or return the value of the local datetime 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:** Only after setting the name attribute can data be submitted to the server upon form submission.


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:

datetimelocalObject

.name

Set the name attribute:

datetimelocalObject

.name=

name

Attribute 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 »


Related pages

HTML Reference Manual: HTML name attribute


Input DatetimeLocal Object Reference Input DatetimeLocal Object