Introduction
The <a> tag defines an anchor. The HTML <a> tag
is used for creating a hyperlink to another web page. The <a> tag is supported in all major browsers. All HTML links are created with the <a> tag. You can also use JavaScript to create links, but you'd only do this if you're trying to do something more complicated than HTML can handle.
An anchor can be used in two ways:
1. To create a link to another document, by using the href attribute.
2. To create a bookmark inside a document, by using the name attribute.
2. To create a bookmark inside a document, by using the name attribute.
Attributes
There are 3 kinds of attributes that you can add to your
HTML tags: Element-specific, global, and event handler content attributes. The attributes that you can add to this tag are listed below.
Element-Specific Attributes
Attributes Introduced by
HTML5
| Attributes | Description |
| href | Specifies the destination of the target URL. |
| target | Specifies where to open
the target URL.
Possible values:
|
| rel | Specifies the relationship between the current document and the target URL. |
| media | Specifies what media/device the target URL is optimized for. Default value: all |
| hreflang | Specifies the language of the target URL. |
| type (New) | Specifies the MIME type of the linked resource. Only to be used when the href attribute is present. |
Attributes not Introduced by
HTML5
| Attributes | Description |
| rev | Not supported in HTML5. |
| shape | Not supported in HTML5. |
| name | Not supported in HTML5. |
| charset | Not supported in HTML5. |
| coords | Not supported in HTML5. |
Global Attributes
|
HTML5
Global Attributes
|
||
| accesskey | draggable | style |
| class | hidden | tabindex |
| dir | spellcheck | |
| contenteditable | id | title |
| contextmenu | lang | |
Event Handler Content Attributes
Event handler content attributes enable you to invoke a
script from within your HTML. The script is invoked when a certain "event"
occurs. Each event handler content attribute deals with a different event.
Here are the standard HTML 5 event handler content
attributes.
| onabort | onerror* | onmousewheel |
| onblur* | onfocus* | onpause |
| oncanplay | onformchange | onplay |
| oncanplaythrough | onforminput | onplaying |
| onchange | oninput | onprogress |
| onclick | oninvalid | onratechange |
| oncontextmenu | onkeydown | onreadystatechange |
| ondblclick | onkeypress | onscroll |
| ondrag | onkeyup | onseeked |
| ondragend | onload* | onseeking |
| ondragenter | onloadeddata | onselect |
| ondragleave | onloadedmetadata | onshow |
| ondragover | onloadstart | onstalled |
| ondragstart | onmousedown | onsubmit |
| ondrop | onmousemove | onsuspend |
| ondurationchange | onmouseout | ontimeupdate |
| onemptied | onmouseover | onvolumechange |
| onended | onmouseup | onwaiting |






Shalini JunejaPosted Aug 22, 2011, 4:17 AM
Good Article Valon........
Eddie JackPosted Aug 22, 2011, 4:11 AM
Good work. thanks