Other Attributes
The tag has many other attributes but is not used as much as ‘href’. It has all universal, UI event attributes and the following attributes
- access key
- charset
- coords
- href
- hreflang
- rel
- rev
- shape
- style
- tabindex
- target type
accesskey – It is used to assign a keyboard shortcut to activate a link like Alt and G can be used for link activation. Some browsers follow the link on activation but some just highlight, and the user has to press the Enter (or Return) key for the link to be followed. It is given in the source anchor and is case-insensitive like, to make ‘K’ as an access key tag is given as
<a href=”ww.vskills.in” accesskey=”k”>K-6 Engine</a>
charset – It tells the character encoding of the document the URL points to and is used if linking to a different language web page which uses a different character set like UTF-8 or ISO-8859-1 as shown
<a href=”http://www.google.jp/” charset=”ISO-2022-JP”>Google Japan</a>
coords – It is used to make an image map, in which different parts of a image are used as hyperlink to point to different places. Its value is a set of x and y coordinates which tell which part of image make a link.
hreflang – The hreflang attribute indicates which language the page you are linking to is written in. It’s designed to be used when linking to a page in a different language from the current document, and the value of this attribute is a two-letter language code. For example:
<a href=”http://www.google.in/” hreflang=”HI”>Google in Hindi</a>
rel – It is used on the source anchor to specify relationship between the current web page and the target resource in href attribute. Browsers do not make use of it and it used as
<a href=”#t Tableofcontent” rel=”toc”> Tableofcontent </a>.
rev – It is similar to rel attribute but is used in destination anchor to specify the relation between the destination and the source but is not supported by browsers.
shape – It is used with an image map to specify the shape of an area that becomes a clickable hotspot like square, circle, etc.
tabindex – It specifies the order in which, when the Tab key is pressed, the links or form controls (like text box) obtain focus. It can take a value of a number between 0 and 32767 with lowest receiving focus first and remaining in the increasing order. So, when the user clicks the Tab key, the control or link with lowest tabindex value gets it and next tab press will go to second lowest and likewise.
target – It indicates whether on clicking a link, it will open in the same browser window or a new browser window, as shown
<a href=”certification.html” target=”_blank”>Certification</a>
It takes value as listed in the table
Value | Description |
_blank | Open the linked document in a new window or tab |
_self | Open the linked document in the same frame as it was clicked (this is default) |
_parent | Open the linked document in the parent frameset |
_top | Open the linked document in the full body of the window |
title – It is used provide a visual text tool tip or an auditory clue in voice browsers for the visually impaired.
type – It indicates MIME type of the link as shown
<a href=”application.doc” type=”application/msword”>Application Form</a>
Apply for HTML5 Certification Now!!
http://www.vskills.in/certification/Certified-HTML5-Developer