YouTip LogoYouTip

Prop Url Name

HTML DOM Input URL name Property

HTML DOM Input URL name Property

-- Learning is not just about technology, but also about dreams!

JavaScript Reference Manual

Overview

JavaScript Objects

Browser Objects

DOM Objects

HTML Objects

<input> - time

<input> - week

Input URL name Property

Input URL Object Reference Manual Input URL Object

Example

Get the name of the URL field:

var x = document.getElementById("myURL").name;

x output result is:

website

Try it yourself Β»


Definition and Usage

The name property is used to set or return the value of the name attribute of the URL field.

The name property is typically 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 the form is submitted.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the name property.

Note: Internet Explorer and Safari do not support the HTML <input> element with the type="url" attribute.


Syntax

Return the name property:

_urlObject_.name

Set the name property:

_urlObject_.name=_name_

Property Values

Value Description
name Describes the name of the URL field

Technical Details

Return Value: A string representing the name of the URL field

More Examples

Example

Change 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 Reference Manual Input URL Object

<input> - time

<input> - week

← Prop Url ReadonlyProp Url Name β†’