HTML DOM Input Datetime name attribute
Examples
Get the name of datetime field:
var x = document.getElementById("myDatetime").name;
x The output is: bdaytime
try it"
Definition and Usage
name attribute is used to set or return the name attribute value datetime field.
name attribute is typically used to server identifiers submitted form data, or the client as a Javascript reference identification.
Note: Only the name attribute is set, in the form submission to submit data to the server.
Browser Support
All major browsers support attribute name
Note: Internet Explorer, Firefox, Opera 15 ( and higher) or Chrome supports the <input> element using type = "datetime".
grammar
Returns the name attribute:
datetimeObject .name
Setting name attribute:
datetimeObject .name= name
Property Value
值 | 描述 |
---|---|
name | 描述了 datetime 字段的名称 |
technical details
return value: | A string representing the name of datetime field |
---|
More examples
Examples
Modify the name of datetime field:
document.getElementById("myDatetime").name = "newDatetimeName";
try it"
Related Pages
HTML Reference Manual: HTML <the INPUT> name attribute
Input Datetime Object