Basic HTML

Advance HTML

HTML Tags Reference

HTML Code Generator


HTML <a> Tag


HTML <a> tag defines an anchor link.

An anchor to create or set link either internally or externally. A link is a connection from one Web resource to another. Another way link is primary concept to drive one page to another page into a web.

User linked from text file, image file or any other resource files to current document using HREF attribute. and TITLE attribute use for provide a description of that location file, which are linked to current document.

The most required attribute of the <a> tag is the href attribute, which are indicates the link's destination.

HREF link will appear below:
1.) Unvisited link is blue with underline.
2.) Visited link is maroon with underline.
3.) Active link is green with underline.


Example-Code:

Click Here to open <a href="http://www.way2tutorial.com/" 
target="_blank"> Way2Tutorial Web Development Tutorials</a>
Online Try This Code Your Self....   »

Example-Result:

More a Tag Example

1.  Link Open New Window
2.  Image Link
3.  Same Page Link
4.  Mailto Link (Feedback Link)


<a> tag Attributes

<a> tag have support following special attributes.

Attributes Value Description
href "URL" Specifies the destination link document.
name "internal_name" Specifies the name of an anchor it's use in Internal Link.
rel "text" relationship between current document or linked document.
rev "text" relationship between linked document or current document.
target _blank
_parent
_self
_top
Loads the linked document in new window.
Loads the linked document in the parent frame.
Loads the linked document in the same window.
Loads the linked document in the top up on same window.

Dynamic Attributes

<a> tag have support following Dynamic attributes.

Attributes Value Description
id ID_Name Declared unique id for the element.
class Predefined_Class Used in Cascading Style Sheet (CSS).
style style_Attributes CSS code specify inline the HTML element is presented.
title Title_Description Display on the "tooltip" for your elements.

Event Attributes

<a> tag have support following Event attributes.

Attributes Value Description
onfocus "Java_script" element gets focus on object when script tobe run.
onblur "Java_script" element lose the focus on object when scrip tobe run.
onclick "Java_script" clicked on object when script tobe run.
ondblclick "Java_script" double click on object when script tobe run.
onkeydown "Java_script" key is pressed when script tobe run.
onkeypress "Java_script" key is pressed over element then released when script tobe run.
onkeyup "Java_script" key is released over element when script tobe run.
onmousedown "Java_script" mouse button was pressed over an element when script tobe run.
onmouseout "Java_script" mouse pointer release over an element when script tobe run.
onmousemove "Java_script" run mouse pointer moved when script tobe run.
onmouseover "Java_script" run mouse pointer move over when script tobe run.
onmouseup "Java_script" mouse button is released when script tobe run.