HTML DOM Input Number name attribute
Examples
Being number Field Name:
var x = document.getElementById("myNumber").name;
x The output is: quantity
try it"
Definition and Usage
name attribute is used to set or return the name attribute value number 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 9 and earlier versions of IE do not support the use of type = "number" <input> element attributes.
grammar
Returns the name attribute:
numberObject .name
Setting name attribute:
numberObject .name= name
Property Value
值 | 描述 |
---|---|
name | 描述了 number 字段的名称 |
technical details
return value: | A string representing the name of the field number |
---|
More examples
Examples
Modify the name of number fields:
document.getElementById("myNumber").name = "newNumberName";
try it"
Related Pages
HTML Reference Manual: HTML <the INPUT> name attribute
Input Number Object