Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

href property

Sets or retrieves the entire URL as a string.

Syntax

JavaScript

p = object.href

 

Property values

Type: String

a URL.

Standards information

Examples

This example shows a URL list. The user is taken to the URL selected from the options, if the selection is different from the list's default value.


<select onchange="javascript:window.location.href = this.options[this.selectedIndex].value;">
  <option value="http://www.microsoft.com/ie">Internet Explorer</option>
  <option value="http://www.microsoft.com">Microsoft Home</option>
  <option value="http://msdn.microsoft.com">Developer Network</option>
</select>

See also

location
navigate

 

 

Show:
© 2015 Microsoft