Input URL nameProperty
Example
Get the name of the URL field:
var x = document.getElementById("myURL").name;
xThe output result is:website
Try it Yourself »
Definition and Usage
The name property sets or returns the value of the name attribute of the URL field.
The name attribute is usually used as an identifier for submitting form data to the server, or as a reference identifier for JavaScript on the client side.
Note:Only when the name attribute is set can data be submitted to the server after form submission.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the name attribute.
Note:Internet Explorer or Safari browsers do not support HTML <input> elements with the type="url" attribute.
Syntax
Return the name attribute:
urlObject.name
Set the name attribute:
urlObject.name=name
Property Values
| Value | Description |
|---|---|
| name | Specifies the name of the URL field |
Technical Details
| Return Value: | A string, representing the name of the URL field |
|---|
More Examples
Example
Modify the name of the URL field:
document.getElementById("myURL").name = "newNameValue";
Try it Yourself »
Related Pages
HTML Reference Manual:HTML <input> name Attribute
Input URL Object Other Extensions