YouTip LogoYouTip

Prop Datetime Name

HTML DOM Input Datetime name Property

HTML DOM Input Datetime name Property

HTML DOM Input Datetime name Property

-- Learning is not just about technology, but also about dreams!

JavaScript Reference Manual

Overview

JavaScript Objects

JavaScript Array Object JavaScript Boolean Object JavaScript Date Object JavaScript Math Object JavaScript Number Object JavaScript String Object JavaScript RegExp Object JavaScript Global Properties/Functions JavaScript Operators JavaScript Error

Browser Objects

Window Object Navigator Object Screen Object History Object Location Object Storage Object

DOM Objects

HTML DOM Document Object HTML DOM Element Object HTML DOM Attribute Object HTML DOM Event Object HTML DOM Console Object CSSStyleDeclaration Object DOM HTMLCollection

HTML Objects

<a> <area> <audio> <base> <blockquote> <body> <button> <canvas> <col> <colgroup> <datalist> <del> <details> <dialog> <embed> <fieldset> <form> <iframe> <frameset > <img> <ins> <input> - button <input> - checkbox <input> - color <input> - date <input> - datetime <input> - datetime-local <input> - email <input> - file <input> - hidden <input> - image <input> - month <input> - number <input> - range <input> - password <input> - radio <input> - reset <input> - search <input> - submit <input> - text <input> - time <input> - url <input> - week <keygen> <link> <label> <legend> <li> <map> <menu> <menuItem> <meta> <meter> <object> <ol> <optgroup> <option> <param> <progress> <q> <script> <select> <source> <style> <table> <td> <th> <tr> <textarea> <title> <time> <track> <video>

<input> - date <input> - datetime-local

Input Datetime name Property

Input Datetime Object Reference Manual Input Datetime Object

Example

Get the name of the datetime field:

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

x output result is:

bdaytime

Try it yourself Β»


Definition and Usage

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

The name property is typically used as an identifier to submit form data to the server, or as a reference identifier for JavaScript on the client side.

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


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

The name property is supported by all major browsers.

Note: Internet Explorer, Firefox, Opera 15 (and later) or Chrome support the <input> element with type="datetime".


Syntax

Return the name property:

datetimeObject.name

Set the name property:

datetimeObject.name=name

Property Values

Value Description
name Specifies the name of the datetime field

Technical Details

Return Value: A string, representing the name of the datetime field

More Examples

Example

Change the name of the datetime field:

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

Try it yourself Β»


Related Pages

HTML Reference: HTML <input> name attribute


Input Datetime Object Reference Manual Input Datetime Object

← Prop Datetime ReadonlyProp Datetime Form β†’