YouTip LogoYouTip

Prop Url Value

HTML DOM Input URL value Property

HTML DOM Input URL value Property

HTML DOM Input URL value 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

Deep Dive

  • Computer Science
  • Web Design and Development
  • Web Service
  • Network Services
  • Programming
  • Software
  • Programming Languages
  • Development Tools
  • Scripts
  • Scripting Languages

Input URL value Property

Input URL Object Reference Manual Input URL Object

Example

Change the value of the URL field:

document.getElementById("myURL").value = "http://www.google.com";

Try it Yourself Β»


Definition and Usage

The value property sets or returns the value of the value attribute of a URL field.

The value property describes the value entered by the user, or the default value, or the value entered by a script.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

The value property is supported in all major browsers.

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


Syntax

Return the value property:

urlObject.value

Set the value property:

urlObject.value=URL

Property Values

Value Description
URL Specifies an absolute URL address (e.g., "http://www.w3cschool.cc")

Technical Details

Return Value: A string, representing the value of the URL field

More Examples

Example

Get the value of the URL field:

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

The value of x will be:

Try it Yourself Β»


Related Pages

HTML Reference: HTML <input> value Attribute


Input URL Object Reference Manual Input URL Object

← Prop Url ValueProp Url Type β†’