YouTip LogoYouTip

Prop Url Name

HTML DOM Input URL name Attribute

HTML DOM Input URL name Attribute

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

JavaScript Reference

Overview

JavaScript Objects

Browser Objects

DOM Objects

HTML Objects

<input> - time

<input> - week

Input URL name Attribute

Input URL Object Reference 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 sets or returns the value of the name attribute of a URL field.

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


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the name property.

Note: Internet Explorer or Safari browsers 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 Specifies 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: HTML <input> name Attribute


Input URL Object Reference Input URL Object

<input> - time

<input> - week

← Prop Url NameProp Url Maxlength β†’