Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
HTML and CSS
Properties
 href Property
HREF Attribute | href Property

Sets or retrieves the baseline URL on which relative links are based.

Syntax

HTML<ELEMENT HREF = sURL... >
Scripting[ sURL = ] object.href

Possible Values

sURLString that specifies or receives the URL.

The property is read/write. The property has no default value.

DHTML expressions can be used in place of the preceding value(s). As of Internet Explorer 8, expressions are not supported in IE8 mode. For more information, see About Dynamic Properties.

Remarks

 New for Windows Internet Explorer 8 Internet Explorer 8 or later. In IE8 mode, the value of the href attribute depends on the context of the reference to the attribute. When read as a Document Object Model (DOM) attribute, href returns an absolute URL. The value specified by the page author is returned when href is read as a content attribute, when the page is displayed in an earlier document compatibility mode, or when the page is viewed with an earlier version of the browser. For more information, see Attribute Differences in Internet Explorer 8.

Standards Information

This property is defined in HTML 3.2 World Wide Web link and is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 World Wide Web link.

Applies To

BASE, HTMLBaseElement Constructor
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker