A (Anchor) HTML Element

From Appmethod Topics
Jump to: navigation, search

Go Up to HTML Elements Index

The A (anchor) element designates the start or destination of a hypertext link. The anchor element requires the HREF= or the NAME= attribute to be specified and provides the following attributes and events.

Item Description

accesskey

Assigns an access key to an element. An access key is a single character from the document character set. Authors should consider the input method of the expected reader when specifying an accesskey.

charset

Specifies the character encoding of the resource designated by the link.

class

Assigns a class name or set of class names to an element. Any number of elements may be assigned the same class name or names. Multiple class names must be separated by white space characters.

coords

Specifies the position and shape on the screen relative to the top, left corner of the object. The number and order of values depends on the shape being defined. Possible combinations:rect left-x, top-y, right-x, bottom-y.circle center-x, center-y, radius. When the radius value is a percentage value, user agents should calculate the final radius value based on the associated object's width and height. The radius should be the smaller value of the two.poly x1, y1, x2, y2, ..., xN, yN. The first x and y coordinate pair and the last should be the same to close the polygon. When these coordinate values are not the same, user agents should infer an additional coordinate pair to close the polygon.

dir

Specifies the direction of directionally neutral text in an element's content and attribute values:ltr indicates left-to-right text or table.rtl indicates right-to-left text or table.

href

Specifies the location of a Web resource and definines a link between the current element (the source anchor) and the destination anchor defined by this attribute.

hreflang

Specifies the base language of the resource designated by href and may only be used when href is specified.

id

Assigns a name to an element. This name must be unique in a document.

lang

Specifies the base language of an element's attribute values and text content. The default value of this attribute is unknown.

name

Assigns the control name.

onblur

The onblur event occurs when an element loses focus either by the pointing device or by tabbing navigation.

onclick

The onclick event occurs when the pointing device button is clicked over an element.

ondblclick

The ondblclick event occurs when the pointing device button is double clicked over an element.

onfocus

The onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation.

onkeydown

The onkeydown event occurs when a key is pressed down over an element.

onkeypress

The onkeypress event occurs when a key is pressed and released over an element.

onkeyup

The onkeyup event occurs when a key is released over an element. This attribute may be used with most elements.

onmousedown

The onmousedown event occurs when the pointing device button is pressed over an element.

onmousemove

The onmousemove event occurs when the pointing device is moved while it is over an element.

onmouseout

The onmouseout event occurs when the pointing device is moved away from an element.

onmouseover

The onmousemove event occurs when the pointing device is moved while it is over an element.

onmouseup

The onmouseup event occurs when the pointing device button is released over an element.

rel

Specifies the relationship from the current document to the anchor specified by the href attribute. The value of this attribute is a space-separated list of link types.

rev

Specifies a reverse link from the anchor specified by the href attribute to the current document. The value of this attribute is a space-separated list of link types.

shape

When the type attribute is set to image, this attribute specifies the location of the image to be used to decorate the graphical submit button.

style

Specifies style information for the current element. The syntax of the value of the style attribute is determined by the default style sheet language.

tabindex

Specifies the position of the current element in the tabbing order for the current document. This value must be a number between 0 and 32767. User agents should ignore leading zeros.

title

Specifies advisory information about the element for which it is set.

type

Provides an advisory hint as to the content type of the content available at the link target address. It allows user agents to opt to use a fallback mechanism rather than fetch the content if they are advised that they will get content in a content type they do not support. Authors who use this attribute take responsibility to manage the risk that it may become inconsistent with the content available at the link target address. For the current list of registered content types, please consult the www.w3.org web site.


See Also