Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Location href Property

Location href Property

Location Object Reference Location object


Definition and Usage

The href property is a read-write string that sets or returns the complete URL of the currently displayed document.

Syntax

location.href


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the href property.


Example

Example

Return the complete URL (current page):

The example above produces the following output:

Try it »


Location Object Reference Location object