Last Updated : 12 Jul, 2025
The <a> tag defines a hyperlink, which is used to link from one page to another. The most important attribute of the <a> element is the href attribute, which indicates the link's destination. This attribute determines where the user is directed upon clicking the link.
HTML
<a href="https://www.geeksforgeeks.org//html/html-tutorial/">
html tutorial
</a>
Syntax:
<a href = "link"> Link Name </a>
By default, links appear as follows in all browsers:
To open a link in a new browser Tab, add the target="_blank" attribute:
HTML
<a href="https://www.geeksforgeeks.org/" target="_blank">GeeksforGeeks</a>
2. Linking to Email Addresses and Phone Numbers:
<a href="mailto:example@xyz.com">Send email</a>
<a href="tel:+910000000">+910000000</a>
3. Creating Internal Page Anchors
To link to another section on the same page:
HTML
<a href="#section1">Go to Section 1</a>
4. Executing JavaScript
To trigger JavaScript code:
HTML
<a href="javascript:alert('Hello Geek');">Execute JavaScript</a>
Attributes:
Attributes
Description
It specifies the character set. It is not supported by HTML 5.
It is used to specify the target link to download when the user clicks.
It is used to specify the language of the linked document.
It is used to specify the linked media.
It is used to specify the anchor name. It is not supported by HTML 5 you can use the global id attribute instead.
It is used to specify the relation between the current document and the linked document.
It is used to specify the shape of the link. It is not supported by HTML 5.
It is used to specify the type of links.
It specifies the target link.
It is used to specify the relation between the linked document and the current document. It is not supported by HTML 5.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4