Input Month name attribute
Definition and Usage
name
Set or return the value of the name attribute of the month field.
The HTML name attribute is used to identify form data after form data is submitted to the server, or to reference form data on the client using JavaScript.
Beachtung:Only form elements that have a name attribute will pass their values when submitting the form.
See also:
HTML Reference Manual:HTML <input> name-Attribut
Example
Example 1
Get the name of the month field:
var x = document.getElementById("myMonth").name;
Example 2
Change the name of the month field:
document.getElementById("myMonth").name = "newMonthName";
Syntax
Return the name attribute:
monthObject.name
Set the name attribute:
monthObject.name = name
Attributwert
Wert | Beschreibung |
---|---|
name | Bestimmt den Namen des Monatsfelds. |
Technische Details
Rückgabewert: | Zeichenfolgenwert, der den Namen des Monatsfelds angibt. |
---|
Browser-Unterstützung
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Unterstützt | 10.0 | Unterstützt | Unterstützt | Unterstützt |
Beachtung:Das Element <input type="month"> zeigt in Firefox kein Datumsfeld/Kalender an.