26 out of 35 rated this helpful - Rate this topic

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="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

 

 

Send comments about this topic to Microsoft

Build date: 11/27/2012

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.