Input URL name attribute
Definition and Usage
name
Sets or returns the value of the name attribute of the URL field.
The HTML name attribute is used to identify form data after submitting form data to the server, or to reference form data on the client using JavaScript.
Note:Only form elements with the name attribute will pass their values when submitting the form.
See also:
HTML Reference Manual:HTML <input> name Attribute
Instance
Example 1
Get the name of the URL field:
var x = document.getElementById("myURL").name;
Example 2
Change the name of the URL field:
document.getElementById("myURL").name = "newNameValue";
Syntax
Return name attribute:
urlObject.name
Set name attribute:
urlObject.name = name
Attribute Value
Value | Description |
---|---|
name | Specifies the name of the URL field. |
Technical Details
Return Value: | A string value that represents the name of the URL field. |
---|
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Supported | 10.0 | Supported | Not Supported | Supported |