A Element | A Object

MS Office DHTML, HTML & CSS

A Element | A Object


Designates the start or destination of a hypertext link.

HTML 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 | _search | _self | _top 
    TITLE=text
    URN=urn
    event = script
>

Remarks

The A (anchor) element requires the href or the name property to be specified.

Both text and images can be included within an anchor. An image that is an anchor has a border whose color indicates whether the link has been visited.

The A element is an inline element and requires a closing tag.

This element is available in HTML and script as of Microsoft® Internet Explorer 3.0.

Members

Styles

Example

The following examples use the A element to link files, open a file, include an image as part of a link, define an anchor, and invoke a function.

<-- Link to a server. -->
<A HREF="http://www.microsoft.com">Microsoft home page.</A>

<-- Link to a file in the same directory. -->
<A HREF="home.htm">home.htm</A>

<-- Open a file in the window specified by TARGET. -->
<A TARGET="viewer" HREF="sample.htm">Open in window</A>

<-- Include an IMG element as a part of the link. -->
<A HREF="http://www.microsoft.com"><IMG SRC="images/bullet.gif">link</A> 

<-- Link to an anchor. -->
<A HREF="#anchor">anchor</A>

<-- Define an anchor. -->
<A NAME="anchor">

<-- Invoke a JScript function -->
<A HREF="javascript:window.open()">link</A>

Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.