YouTip LogoYouTip

Prop Date Name

HTML DOM Input Date name Property

HTML DOM Input Date name Property

-- Learning not just technology, but 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>

Image 8: Input Date Object Reference Manual Input Date Object

Input Date name Property

Example

Get the name of the date field:

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

x output result is:

bday

Try it yourself Β»


Definition and Usage

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

The name property is typically used as an 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

Image 9: Internet ExplorerImage 10: FirefoxImage 11: OperaImage 12: Google ChromeImage 13: Safari

The name property is supported by all major browsers.

Note: Internet Explorer and Firefox 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 Specifies 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 Manual: HTML <input> name Attribute


Image 14: Input Date Object Reference Manual Input Date Object

← Prop Date ReadonlyProp Date Form β†’