Contents Index Topic Contents | ||
Previous Topic: !DOCTYPE Next Topic: ACRONYM |
A
Description
Designates the start or destination of a hypertext link. The anchor element requires the HREF= or the NAME= attribute to be specified.
Syntax
<A
ACCESSKEY=key
CLASS=classname
DATAFLD=colname
DATASRC=#ID
HREF=url
ID=value
LANG=language
LANGUAGE=JAVASCRIPT | JSCRIPT | VBSCRIPT | VBS
METHODS=http-method
NAME=name
REL="stylesheet"
REV="stylesheet"
STYLE=css1-properties
TABINDEX=n
TARGET=window_name | _blank | _parent | _self | _top
TITLE=text
URN=urn
event = script
>
Parameter Description ACCESSKEY=key Accelerator for the element. Pressing ALT-key selects this element in the user's browser. CLASS=classname Class of the tag being defined. This is used to associate a subclassed style sheet with the tag. DATAFLD=colname Column name from the data source object that supplies the bound data. DATASRC=#ID ID of the data source object that supplies the data that is bound to this element. HREF=url Destination URL or anchor point. If HREF is set to an empty string (""), then hyperlinking will cause the base URL to be opened. For example, if the current file is "http://microsoft.com/home/hello.html", then "http://microsoft.com/home/" will be opened. ID=value SGML identifier used as the target for hypertext links or for naming particular elements in associated style sheets. Valid ID values must begin with a letter. The underscore character, "_", may be used in the ID name. The ID should be unique throughout the scope of the document. If more than one object with the same identifier exists in a document, a collection of those named items is created that can only be referenced by ordinal position. LANG=language Specifies which language to use in ISO standard language abbreviation form. LANGUAGE=JAVASCRIPT | JSCRIPT | VBS | VBSCRIPT Specifies the language the current script is written in and invokes the proper scripting engine. The default value is JAVASCRIPT.
JAVASCRIPT, JSCRIPT The script is written in JScript. VBS, VBSCRIPT The script is written in VBScript. METHODS=http-method METHODS attributes of anchors and links provide information about the functions that the user may perform on an object. These are more accurately given by the HTTP protocol when it is used, but it may, for similar reasons as for the TITLE attribute, be useful to include the information in advance in the link. For example, the HTML user agent may choose a different rendering as a function of the methods allowed; for example, something that is searchable may get a different icon. NAME=name Name of the anchor. REL="stylesheet" Gives the relationship(s) described by the hypertext link from the anchor to the target. The value is a comma-separated list of relationship values. The values and their semantics will be registered by the HTML registration authority. The default relationship if none other is given is void. The REL attribute is only used when the HREF= attribute is present. REV="stylesheet" Same as the REL attribute, but the semantics of the link type are in the reverse direction. A link from A to B with REL="X" expresses the same relationship as a link from B to A with REV="X". An anchor may have both REL and REV attributes. STYLE=css1-properties Inline style sheet for the tag. TABINDEX=n Sets the tab order position for the object. TARGET=window_name | _blank | _parent | _self | _top Window or frame at which to target the contents. If no frame or window exists that matches the specified target, a new window is opened for the specified link. If no target is specified, the default is "_self" for a link within the same site or "_top" if the site is external. Special target values are:
_blank Specifies to load the link into a new unnamed window. _parent Specifies to load the link into the immediate parent of the document the link is in. _self Specifies to load the link into the same window the link was clicked in. _top Specifies to load the link into the full body of the current window. TITLE=text Used to provide advisory information. The contents of the title attribute will be displayed in a tooltip during the onmouseover event. event Can be one or more of these events:
onblur onclick ondblclick ondragstart onfocus onhelp onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onselectstart Remarks
Text and/or images may be within an anchor. To represent images that are anchors, a border in the visited or not visited color is displayed.
Both the start and end tags are required.
Example
<A HREF="http://www.microsoft.com">This is a link to Microsoft.</A> <A HREF="home.htm">This link points to a file called home.htm in the same directory as this page.</A> <A TARGET="viewer" HREF="sample.htm">Click here to load the link into "viewer" window.</A> <A HREF="http://www.microsoft.com"><IMG SRC="images/bullet.gif">This link contains an image</A> <A HREF="javascript:window.open()">This link opens a new window using the open method in javascript</A>Scripting Object
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.