href property
Sets or retrieves the entire URL as a string.
Syntax
| JavaScript | |
|---|
Property values
Type: String
a URL.
Standards information
- Document Object Model (DOM) Level 1 Specification, Section 2.5.5
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
Send comments about this topic to Microsoft
Build date: 11/27/2012